コード例 #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;
 }
コード例 #2
0
 protected BaseDbContext(DbContextOption option)
 {
     Option = option ?? throw new ArgumentNullException(nameof(option));
 }
コード例 #3
0
 public SqlServerDbContext(DbContextOption option) : base(option)
 {
 }