Exemple #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="option"></param>
 protected BaseDbContext(IOptions <DbContextOption> option)
 {
     if (option == null)
     {
         throw new ArgumentNullException(nameof(option));
     }
     if (string.IsNullOrEmpty(option.Value.ConnectionString))
     {
         throw new ArgumentNullException(nameof(option.Value.ConnectionString));
     }
     Option = option.Value;
 }
Exemple #2
0
 protected BaseDbContext(DbContextOption option)
 {
     Option = option ?? throw new ArgumentNullException(nameof(option));
 }
 public SqlServerDbContext(DbContextOption option) : base(option)
 {
 }