当前位置: 首页>>代码示例>>C#>>正文


C# IServiceCollection.AddAbp方法代码示例

本文整理汇总了C#中IServiceCollection.AddAbp方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceCollection.AddAbp方法的具体用法?C# IServiceCollection.AddAbp怎么用?C# IServiceCollection.AddAbp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceCollection的用法示例。


在下文中一共展示了IServiceCollection.AddAbp方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            var mvc = services.AddMvc();

            mvc.PartManager.ApplicationParts.Add(new AssemblyPart(typeof(AbpAspNetCoreModule).Assembly));

            //Configure Abp and Dependency Injection
            return services.AddAbp<AppModule>(options =>
            {
                //Test setup
                options.SetupTest();
            });
        }
开发者ID:vytautask,项目名称:aspnetboilerplate,代码行数:13,代码来源:Startup.cs

示例2: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(options =>
            {
                options.AddAbp(services); //Add ABP infrastructure to MVC
            }).AddControllersAsServices();

            //Configure Abp and Dependency Injection
            return services.AddAbp<AppModule>(options =>
            {
                //Test setup
                options.SetupTest();
            });
        }
开发者ID:ZhaoRd,项目名称:aspnetboilerplate,代码行数:14,代码来源:Startup.cs

示例3: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddEntityFrameworkInMemoryDatabase();

            services.AddMvc(options =>
            {
                options.AddAbp(services); //Add ABP infrastructure to MVC
            });

            //Configure Abp and Dependency Injection
            return services.AddAbp<BPEWebTestModule>(options =>
            {
                options.SetupTest();
            });
        }
开发者ID:RedFoxTechnologies,项目名称:bpe,代码行数:15,代码来源:Startup.cs

示例4: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(Configuration);

            //Add framework services
            services.AddMvc(options =>
            {
                options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
            });

            //Configure Abp and Dependency Injection. Should be called last.
            return services.AddAbp<AbpAspNetCoreDemoModule>(options =>
            {
                //Configure Log4Net logging
                options.IocManager.IocContainer.AddFacility<LoggingFacility>(
                    f => f.UseAbpLog4Net().WithConfig("log4net.config")
                );
            });
        }
开发者ID:vytautask,项目名称:aspnetboilerplate,代码行数:20,代码来源:Startup.cs

示例5: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<MyDbContext>(
                options => options.UseSqlServer(Configuration.GetConnectionString("Default"))
            );

            services.AddMvc(options =>
            {
                options.AddAbp(); //Add ABP infrastructure to MVC
            }).AddControllersAsServices();

            //Configure Dependency Injection
            return services.AddAbp(abpBootstrapper =>
            {
                //Configure Log4Net logging
                abpBootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(
                    f => f.UseLog4Net().WithConfig("log4net.config")
                );
            });
        }
开发者ID:tangname,项目名称:aspnetboilerplate,代码行数:20,代码来源:Startup.cs

示例6: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<MyDbContext>(options =>
            {
                options.UseSqlServer(Configuration.GetConnectionString("Default"));
            });

            services.AddMvc(options =>
            {
                options.AddAbp(services); //Add ABP infrastructure to MVC
            });

            //Configure Abp and Dependency Injection. Should be called last.
            return services.AddAbp(options =>
            {
                //Configure Log4Net logging
                options.IocManager.IocContainer.AddFacility<LoggingFacility>(
                    f => f.UseLog4Net().WithConfig("log4net.config")
                );
            });
        }
开发者ID:abdllhbyrktr,项目名称:aspnetboilerplate,代码行数:21,代码来源:Startup.cs

示例7: ConfigureServices

        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            //Configure DbContext
            services.AddAbpDbContext<BPEDbContext>(options =>
            {
                DbContextOptionsConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
            });

            services.AddMvc(options =>
            {
                options.AddAbp(services); //Add ABP infrastructure to MVC
            });

            //Configure Abp and Dependency Injection
            return services.AddAbp<BPEWebModule>(options =>
            {
                //Configure Log4Net logging
                options.IocManager.IocContainer.AddFacility<LoggingFacility>(
                    f => f.UseLog4Net().WithConfig("log4net.config")
                );
            });
        }
开发者ID:RedFoxTechnologies,项目名称:bpe,代码行数:22,代码来源:Startup.cs

示例8: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(Configuration);

            //Add framework services.
            services.AddMvc(options =>
            {
                options.AddAbp(services); //Add ABP infrastructure to MVC
            });

            //Configure Abp and Dependency Injection. Should be called last.
            return services.AddAbp<AbpAspNetCoreDemoModule>(options =>
            {
                //Configure Log4Net logging
                options.IocManager.IocContainer.AddFacility<LoggingFacility>(
                    f => f.UseLog4Net().WithConfig("log4net.config")
                );
            });
        }
开发者ID:ZhaoRd,项目名称:aspnetboilerplate,代码行数:20,代码来源:Startup.cs


注:本文中的IServiceCollection.AddAbp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。