예제 #1
0
        private IApplicationInitializer[] GetInitializers()
        {
            try
            {
                var initializerTypes = _typeScanner.FindTypes <IApplicationInitializer>(ignoreInactiveModules: true);

                return(initializerTypes
                       .Select(x => _scope.ResolveUnregistered(x) as IApplicationInitializer)
                       .OrderBy(x => x.Order)
                       .ToArray());
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Error while resolving application initializers.");
                throw;
            }
        }
예제 #2
0
 public static T ResolveUnregistered <T>(this IComponentContext scope) where T : class
 => (T)scope.ResolveUnregistered(typeof(T));