public AppScope BeginScope(object tag) { var scope = new AppScope(); var lscope = Scope.BeginLifetimeScope(tag, b => b.Register(c => scope) .As <IAppScope>() .AsSelf() .InstancePerLifetimeScope()); scope.Scope = lscope; return(scope); }
public AppScope BeginScope(object tag, Action <ContainerBuilder> confAction) { var scope = new AppScope(); var lscope = Scope.BeginLifetimeScope(tag, b => { b.Register(c => scope) .As <IAppScope>() .AsSelf() .InstancePerLifetimeScope(); confAction(b); }); scope.Scope = lscope; return(scope); }