Beispiel #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);
        }
Beispiel #2
0
        public InMemoryDbFixture()
        {
            var options = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemory").Options;

            DbContext = new StudentResultsDbContext(options);

            DbContext.Database.EnsureCreated();
        }
Beispiel #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();
        }
 public RatingDbService(StudentResultsDbContext context)
 {
     this._context = context;
 }