Пример #1
0
 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 {
     base.OnConfiguring(optionsBuilder);
     try
     {
         ConnectionString = WebConfig.GetConfigItem("SaffetDB").Result;
         Console.WriteLine(ConnectionString);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
     }
     optionsBuilder.UseSqlServer(ConnectionString);
 }