public static BankDBContext Connect(string connectionString) { var optionBuilder = new DbContextOptionsBuilder <BankDBContext>(); optionBuilder.UseMySQL(connectionString); var context = new BankDBContext(optionBuilder.Options); context.Database.EnsureCreated(); return(context); }