本文整理汇总了C#中IServiceCollection.AddEntityFrameworkInMemoryDatabase方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceCollection.AddEntityFrameworkInMemoryDatabase方法的具体用法?C# IServiceCollection.AddEntityFrameworkInMemoryDatabase怎么用?C# IServiceCollection.AddEntityFrameworkInMemoryDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceCollection
的用法示例。
在下文中一共展示了IServiceCollection.AddEntityFrameworkInMemoryDatabase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigureServices
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<HeroesContext>(options => options.UseInMemoryDatabase());
// Add framework services.
services.AddMvc();
}
示例2: ConfigureServices
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<TestContext>(x =>x.UseInMemoryDatabase());
services.AddPomeloLocalization(x =>
{
x.AddCulture(new[] { "zh", "zh-CN", "zh-Hans" }, new JsonLocalizedStringStore(Path.Combine("Localization", "zh-CN.json")));
x.AddCulture(new[] { "en-US" }, new JsonLocalizedStringStore(Path.Combine("Localization", "en-US.json")));
})
.AddBaiduTranslator();
}
示例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: AddProviderServices
public override IServiceCollection AddProviderServices(IServiceCollection services)
=> services.AddEntityFrameworkInMemoryDatabase();
示例5: ApplyServices
public virtual void ApplyServices(IServiceCollection services)
{
Check.NotNull(services, nameof(services));
services.AddEntityFrameworkInMemoryDatabase();
}