public MultiplayerController() { IUserContext userContext = new UserMSSQLContext(); IChatContext chatContext = new ChatMSSQLContext(); userRepository = new UserRepository(userContext); chatRepository = new ChatRepository(chatContext); }
public ChatRepository(IChatContext context) { this.context = context; using (var mysqlContext = new ChatMSSQLContext()) { // Creates the database if not exists mysqlContext.Database.EnsureCreated(); mysqlContext.SaveChanges(); } }
public ChatHub() { IChatContext context = new ChatMSSQLContext(); chatRepository = new ChatRepository(context); }