/// <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); } }
public IServiceLocatorScope CreateScope() { return(new ServiceLocatorScope(_iocManager.CreateScope())); }