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


C# IServiceCollection.AddEntityFrameworkInMemoryDatabase方法代码示例

本文整理汇总了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();
        }
开发者ID:GeorgDangl,项目名称:NetCoreHeroes,代码行数:9,代码来源:Startup.cs

示例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();
        }
开发者ID:yonglehou,项目名称:dotNETCore-Extensions,代码行数: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: AddProviderServices

 public override IServiceCollection AddProviderServices(IServiceCollection services)
     => services.AddEntityFrameworkInMemoryDatabase();
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:InMemoryTestHelpers.cs

示例5: ApplyServices

        public virtual void ApplyServices(IServiceCollection services)
        {
            Check.NotNull(services, nameof(services));

            services.AddEntityFrameworkInMemoryDatabase();
        }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:6,代码来源:InMemoryOptionsExtension.cs


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