asp.net web api - web api 2 singleton -


i have in-memory object graph accessible via asp.net web api 2. get, post, put, delet code executes correctly except accessed collection "untouched" when next action methon called. use fiddler test , own clients. looks collection reconstructed every call. need single object graph accessed clients. can web api configured use singleton data, wcf? or have make data singleton myself? testing in vs.2013, don't have dedicated owin host yet.

  1. create message handler class derives delegatinghandler.
  2. pass graph constructor.
  3. add instance of handler config.messagehandlers collection.
  4. when request passes through message handler, add graph properties collection of request.
  5. create extension method make easy pull graph out of request object.
  6. make sure graph thread safe.

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -