示例#1
0
        internal static void AddCoreAbpServices(this IServiceCollection services,
                                                IAbpApplication abpApplication,
                                                AbpApplicationCreationOptions applicationCreationOptions)
        {
            var moduleLoader   = new ModuleLoader();
            var assemblyFinder = new AssemblyFinder(abpApplication);
            var typeFinder     = new TypeFinder(assemblyFinder);

            if (!services.IsAdded <IConfiguration>())
            {
                services.ReplaceConfiguration(
                    ConfigurationHelper.BuildConfiguration(
                        applicationCreationOptions.Configuration
                        )
                    );
            }

            services.TryAddSingleton <IModuleLoader>(moduleLoader);
            services.TryAddSingleton <IAssemblyFinder>(assemblyFinder);
            services.TryAddSingleton <ITypeFinder>(typeFinder);
            services.TryAddSingleton <IInitLoggerFactory>(new DefaultInitLoggerFactory());

            services.AddAssemblyOf <IAbpApplication>();

            services.Configure <AbpModuleLifecycleOptions>(options =>
            {
                options.Contributors.Add <OnPreApplicationInitializationModuleLifecycleContributor>();
                options.Contributors.Add <OnApplicationInitializationModuleLifecycleContributor>();
                options.Contributors.Add <OnPostApplicationInitializationModuleLifecycleContributor>();
                options.Contributors.Add <OnApplicationShutdownModuleLifecycleContributor>();
            });
        }
 private static IConfigurationRoot ResolveConfiguration(IAbpApplication application)
 {
     return(application
            .ServiceProvider
            .GetRequiredService <IConfigurationAccessor>()
            .Configuration);
 }
示例#3
0
        private static void RunListers(IAbpApplication application)
        {
            application
            .ServiceProvider
            .GetRequiredService <TicketLister>()
            .List();

            application
            .ServiceProvider
            .GetRequiredService <UserLister>()
            .List();

            application
            .ServiceProvider
            .GetRequiredService <BlogPostLister>()
            .List();
        }
        internal static void AddCoreAbpServices(this IServiceCollection services, IAbpApplication abpApplication)
        {
            var moduleLoader   = new ModuleLoader();
            var assemblyFinder = new AssemblyFinder(abpApplication);
            var typeFinder     = new TypeFinder(assemblyFinder);

            services.TryAddSingleton <IModuleLoader>(moduleLoader);
            services.TryAddSingleton <IAssemblyFinder>(assemblyFinder);
            services.TryAddSingleton <ITypeFinder>(typeFinder);

            services.AddAssemblyOf <IAbpApplication>();

            services.Configure <ModuleLifecycleOptions>(options =>
            {
                options.Contributers.Add <OnPreApplicationInitializationModuleLifecycleContributer>();
                options.Contributers.Add <OnApplicationInitializationModuleLifecycleContributer>();
                options.Contributers.Add <OnPostApplicationInitializationModuleLifecycleContributer>();
                options.Contributers.Add <OnApplicationShutdownModuleLifecycleContributer>();
            });
        }
 public ContractTestKit <TModule> Create <TModule>(IAbpApplication application) where TModule : AbpModule
 {
     return(new ContractTestKit <TModule>(application));
 }
 public ContractTestKit(IAbpApplication application)
 {
     Application          = application;
     _contractTestService = Application.ServiceProvider.GetRequiredService <IContractTestService>();
     AsyncHelper.RunSync(InitSystemContractAddressesAsync);
 }
示例#7
0
 public AbpConventionalControllerFeatureProvider(IAbpApplication application)
 {
     _application = application;
 }
示例#8
0
 public AbpAsyncApplicationLifecycleHostedService(IAbpApplication abpApplication)
 {
     _abpApplication = abpApplication;
 }