示例#1
0
        public static IServiceCollection AddDefaultFactoryProvider(this IServiceCollection serviceCollection)
        => serviceCollection.AddSingleton <IFactoryMediator, DefaultFactoryMediator>(p =>
        {
            var factoryProvider = new DefaultFactoryMediator();

            factoryProvider.Init();

            return(factoryProvider);
        });
示例#2
0
        public static IServiceCollection AddDefaultFactoryProvider(this IServiceCollection serviceCollection, Type profileAssemblyMarkerType)
        => serviceCollection.AddSingleton <IFactoryMediator, DefaultFactoryMediator>(p =>
        {
            var factoryProvider = new DefaultFactoryMediator();

            factoryProvider.Init(profileAssemblyMarkerType);

            return(factoryProvider);
        });