Ejemplo n.º 1
0
        private static IOC.ILifetimeScope InitializeDependencyResolver(bool showSql)
        {
            var container = BuildAutofacContainer(showSql);
            var rootScope = container.Resolve <IOC.ILifetimeScope>();

            DbToolDependencyResolver.Initialize(rootScope);

            return(rootScope);
        }
Ejemplo n.º 2
0
 public static void Initialize(ILifetimeScope rootScope)
 {
     if (_current == null)
     {
         _current = new DbToolDependencyResolver(rootScope);
     }
     else
     {
         throw new InvalidOperationException($"{nameof(DbToolDependencyResolver)} already initialized");
     }
 }