/// <summary> /// Creates a new service scope, makes it the ambient scope and returns it. /// </summary> /// <param name="settings"></param> /// <returns></returns> public static ServiceScope NewServiceScope(ServiceScopeSettings settings = null) { if (_globalServiceScope != null) { ServiceScopeInit(new ServiceScope(_globalServiceScope), null); return(_currentServiceScope.Value); } ServiceScopeInit(new ServiceScope(settings ?? new ServiceScopeSettings()), null); return(_currentServiceScope.Value); }
/// <summary> /// Creates a new service scope, makes it the ambient scope and returns it. /// </summary> /// <param name="settings"></param> /// <param name="additionalServices"></param> /// <returns></returns> public static ServiceScope NewServiceScope(ServiceScopeSettings settings, params ICEFService[] additionalServices) { if (_globalServiceScope != null) { ServiceScopeInit(new ServiceScope(_globalServiceScope), additionalServices); return(_currentServiceScope.Value); } ServiceScopeInit(new ServiceScope(settings), additionalServices); return(_currentServiceScope.Value); }