コード例 #1
0
 public IBindingNamedWithOrOnSyntax <T> InRequestScope <T>(IBindingInSyntax <T> syntax)
 {
     return(syntax
            .InScope(context =>
                     RevoStartup.RequestScope(context)
                     ?? (object)TaskContext.Current
                     ?? StandardScopeCallbacks.Thread(context)));
 }
コード例 #2
0
 public IBindingNamedWithOrOnSyntax <T> InTaskScope <T>(IBindingInSyntax <T> syntax)
 {
     return(syntax
            .InScope(context =>
                     (object)TaskContext.Current
                     ?? context.Kernel.Components.GetAll <INinjectHttpApplicationPlugin>()
                     .Select(c => c.GetRequestScope(context)).FirstOrDefault(s => s != null)
                     ?? StandardScopeCallbacks.Thread(context)));
 }
コード例 #3
0
 public IBindingNamedWithOrOnSyntax <T> InTaskScope <T>(IBindingInSyntax <T> syntax)
 {
     return(syntax
            .InScope(context => TaskContext.Current ?? StandardScopeCallbacks.Thread(context)));
 }