public void Setup()
 {
     _options = SqliteInMemory.CreateOptions <EfCoreContext>();
     using (var context = new EfCoreContext(_options))
     {
         context.Database.EnsureCreated();
         context.SeedDatabaseFourBooks();
         _utData = context.SetupSingleDtoAndEntities <AddReviewDto>();
     }
 }
Example #2
0
        public void Setup()
        {
            _options = SqliteInMemory.CreateOptions<EfCoreContext>();
            using (var context = new EfCoreContext(_options))
            {
                context.Database.EnsureCreated();
                if (!context.Books.Any())
                    context.SeedDatabaseFourBooks();
                _utData = context.SetupSingleDtoAndEntities<Tests.Dtos.ChangePubDateDto>();
            }

        }
Example #3
0
        public void Setup()
        {
            var con = this.GetUniqueDatabaseConnectionString(nameof(PerfListMany));

            _options = new DbContextOptionsBuilder <EfCoreContext>().UseSqlServer(con).Options;
            using (var context = new EfCoreContext(_options))
            {
                context.Database.EnsureCreated();
                if (!context.Books.Any())
                {
                    context.SeedDatabaseDummyBooks(100);
                }
                _utData = context.SetupSingleDtoAndEntities <BookListDto>();
            }
        }