コード例 #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;
 }