Beispiel #1
0
 /// <summary>
 ///   Sets component lifestyle to scoped per scope determined by <paramref name = "scopeRootBinder" />
 /// </summary>
 /// <param name = "scopeRootBinder">Custom algorithm for selection which component higher up the resolution stack should be the root of the lifetime scope for current component's instances.
 ///   The delegate will be invoked when current component is about to be resolved and will be passed set of handlers to components higher up the resolution stack. It ought to return one which it designages
 ///   as the root which shall scope the lifetime of current component's instance, or <c>null</c>
 /// </param>
 /// <returns></returns>
 public ComponentRegistration <TService> LifestyleBoundTo(Func <IHandler[], IHandler> scopeRootBinder)
 {
     return(LifeStyle.BoundTo(scopeRootBinder));
 }
Beispiel #2
0
 /// <summary>
 ///   Sets component lifestyle to scoped per nearest component on the resolution stack where implementation type is assignable to <typeparamref
 ///    name = "TBaseForRoot" />.
 /// </summary>
 /// <returns></returns>
 public ComponentRegistration <TService> LifestyleBoundTo <TBaseForRoot>() where TBaseForRoot : class
 {
     return(LifeStyle.BoundTo <TBaseForRoot>());
 }