public static ExplicitArguments ToExplicitArgs(this ServiceArguments arguments) { var explicits = new ExplicitArguments(); arguments.EachService((type, o) => explicits.Set(type, o)); return(explicits); }
public IActionBehavior StartInnerBehavior() { _scope = _windsorContainer.BeginScope(); _arguments.EachService((type, value) => _windsorContainer.Register(Component.For(type).Instance(value).LifestyleScoped())); return(_windsorContainer.Resolve <IActionBehavior>(_behaviorId.ToString())); }
public IActionBehavior StartInnerBehavior() { _nested = _container.GetNestedContainer(); _nested.Configure(x => _arguments.EachService((type, value) => x.For(type).Use(value))); var behavior = _nested.GetInstance <IActionBehavior>(_behaviorId.ToString()); return(behavior); }
public IActionBehavior StartInnerBehavior() { _nestedScope = _lifetimeScope.BeginLifetimeScope( builder => _arguments.EachService((type, value) => builder.Register(context => value).As(type))); var behavior = _nestedScope.ResolveNamed <IActionBehavior>(_behaviorId.ToString()); return(behavior); }
public override void Execute <T>(ServiceArguments arguments, Action <T> action) { using (var nested = _container.GetNestedContainer()) { var explicits = new ExplicitArguments(); arguments.EachService(explicits.Set); action(nested.GetInstance <T>(explicits)); } }
public void Invoke() { using (var nested = _container.GetNestedContainer()) { nested.Configure(x => _arguments.EachService((type, value) => x.For(type).Use(value))); var behavior = nested.GetInstance <IActionBehavior>(_behaviorId.ToString()); behavior.Invoke(); } }
public void Invoke() { using (var nested = _container.GetNestedContainer()) { nested.Configure(cfg => _arguments.EachService((type, value) => cfg.For(type).Use(value))); var request = nested.GetInstance <IFubuRequest>().Get <CurrentRequest>(); if (request.Url.StartsWith("/_content")) { nested.GetInstance <IActionBehavior>(_arguments.ToExplicitArgs(), _behaviorId.ToString()).Invoke(); return; } nested.ExecuteInTransactionWithoutNestedContainer <IContainer>(invokeRequestedBehavior); } }
public static void Apply(this IContainer container, ServiceArguments arguments) { arguments.EachService(container.Inject); }
public static void Apply(this IContainer container, ServiceArguments arguments) { arguments.EachService(container.Inject); }