コード例 #1
0
        public InMemoryContextFactory()
        {
            DbContextOptions <VODContext> contextOptions = new
                                                           DbContextOptionsBuilder <VODContext>()
                                                           .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                           .EnableSensitiveDataLogging()
                                                           .Options;

            this.EnsureCreation(contextOptions);

            ContextInstance = new TestVODContext(contextOptions);
        }
コード例 #2
0
 private void EnsureCreation(DbContextOptions <VODContext> contextOptions)
 {
     using var context = new TestVODContext(contextOptions);
     context.Database.EnsureCreated();
 }