예제 #1
0
파일: Program.cs 프로젝트: HojjatK/roham
        private static IOC.ILifetimeScope InitializeDependencyResolver(bool showSql)
        {
            var container = BuildAutofacContainer(showSql);
            var rootScope = container.Resolve <IOC.ILifetimeScope>();

            DbToolDependencyResolver.Initialize(rootScope);

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