예제 #1
0
 public RegistersFactory(
     TablesDbContext dbc, TablesDbContextForReader rdbc,
     IMongoCollection <AchieversDoc> achieversDocCollection
     )
 {
     this.dbc  = dbc;
     this.rdbc = rdbc;
     this.achieversCollection = achieversDocCollection;
 }
        private void InitializeIfNecessary()
        {
            if (this.initializeDone == false)
            {
                using (var tmpDbContext = new TablesDbContext(
                           dbConnection.ReadWriteDbContextOptions)
                       )
                    tmpDbContext.Database.EnsureCreated();
            }

            this.initializeDone = true;
        }
예제 #3
0
        private void TryAddingPeople(TablesDbContext dbContext)
        {
            dbContext.People.Add(new PersonRow {
                Id = Id1, Name = Name1, Surname = Surname1
            });

            dbContext.People.Add(new PersonRow {
                Id = Id2, Name = Name2, Surname = Surname2
            });

            dbContext.SaveChanges();
        }
예제 #4
0
 public TablesDbController(TablesDbContext context)
 {
     this.Context = context;
 }
예제 #5
0
 public TablesDbPopulator(TablesDbContext dbc)
 {
     this.dbc = dbc;
 }