Exemplo n.º 1
0
 public OwinContext(IDictionary <string, object> environment = null)
 {
     _environment = environment ?? OwinFactory.CreateEnvironment();
     if (!_environment.ContainsKey(OwinKeys.Owin.CallCancelled))
     {
         _environment.Add(OwinKeys.Owin.CallCancelled, new CancellationToken());
     }
     _request  = new OwinRequest(_environment);
     _response = new OwinResponse(_environment);
 }
Exemplo n.º 2
0
 public static OwinContext Get(IDictionary <string, object> environment = null)
 {
     environment = environment ?? OwinFactory.CreateEnvironment();
     return(environment.GetValueOrCreate(ContextKey, () => new OwinContext(environment)));
 }