本文整理汇总了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();
});
}
示例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();
});
}
示例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();
});
}
示例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")
);
});
}
示例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")
);
});
}
示例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")
);
});
}
示例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")
);
});
}
示例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")
);
});
}