예제 #1
0
        public DbFixture()
        {
            var builder = new DbContextOptionsBuilder();

            builder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=BestStudentsResult;Trusted_Connection=True;MultipleActiveResultSets=true");
            DbContext = new StudentResultsDbContext(builder.Options);
        }
예제 #2
0
        public InMemoryDbFixture()
        {
            var options = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemory").Options;

            DbContext = new StudentResultsDbContext(options);

            DbContext.Database.EnsureCreated();
        }
예제 #3
0
        public MsSqlDbFixture()
        {
            var options = new DbContextOptionsBuilder().UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=Tests;Trusted_Connection=True;MultipleActiveResultSets=true").Options;

            DbContext = new StudentResultsDbContext(options);

            DbContext.Database.EnsureCreated();
        }
예제 #4
0
 public RatingDbService(StudentResultsDbContext context)
 {
     this._context = context;
 }