private static IOC.ILifetimeScope InitializeDependencyResolver(bool showSql) { var container = BuildAutofacContainer(showSql); var rootScope = container.Resolve <IOC.ILifetimeScope>(); DbToolDependencyResolver.Initialize(rootScope); return(rootScope); }
public static void Initialize(ILifetimeScope rootScope) { if (_current == null) { _current = new DbToolDependencyResolver(rootScope); } else { throw new InvalidOperationException($"{nameof(DbToolDependencyResolver)} already initialized"); } }