public InMemoryDBUtility() { DbContextOptions <DatingContext> contextOptions = new DbContextOptions <DatingContext>(); DbContextOptionsBuilder optionsBuilderSkill = new DbContextOptionsBuilder(contextOptions); var dboption = optionsBuilderSkill.UseInMemoryDatabase().Options as DbContextOptions <DatingContext>; _dateContext = new DatingContext(dboption); DbContextOptions <UserContext> contextOptionsUser = new DbContextOptions <UserContext>(); DbContextOptionsBuilder optionsBuilderUser = new DbContextOptionsBuilder(contextOptionsUser); var userdboption = optionsBuilderUser.UseInMemoryDatabase().Options as DbContextOptions <UserContext>; _userContext = new UserContext(userdboption); //Skill Connection _dateConnection = new DateConnection(_dateContext); //User Connnection; _userConnection = new UserConnection(_userContext); }
/// <summary> /// Inject DatingContext object /// </summary> public DateRepository(DatingContext dateContext) { _dateConnection = new DateConnection(dateContext); }