DbContextOptionsConfigurer.cs 710 B

12345678910111213141516171819
  1. using CodeFirstExistingDatabaseSample.ISMS_BASE;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.Extensions.Options;
  4. using System;
  5. //using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
  6. //using System;
  7. namespace CodeFirstExistingDatabaseSample
  8. {
  9. public static class DbContextOptionsConfigurer
  10. {
  11. public static void Configure(DbContextOptionsBuilder<ISMS_BASEContext> dbContextOptions, string connectionString)
  12. {
  13. /* dbContextOptions.UseSqlServer("Server=192.168.110.161;User ID=sa;Password=sa;Database=ISMS_BASE;Trusted_Connection=False;")*/;
  14. dbContextOptions.UseSqlServer(connectionString, builder => { builder.CommandTimeout(30); });
  15. }
  16. }
  17. }