示例#1
0
 /// <summary>
 ///     This method starts a scope to resolve and release all objects automatically.
 ///     You can use the <c>scope</c> in <see cref="action" />.
 /// </summary>
 /// <param name="iocResolver">IIocResolver object</param>
 /// <param name="action">An action that can use the resolved object</param>
 public static void UsingScope(this IIocManager iocResolver, Action <IIocScopedResolver> action)
 {
     using (IIocScopedResolver scope = iocResolver.CreateScope())
     {
         action(scope);
     }
 }
示例#2
0
 public IServiceLocatorScope CreateScope()
 {
     return(new ServiceLocatorScope(_iocManager.CreateScope()));
 }