示例#1
0
 public ApplicationDbContext(DbContextOptions <ApplicationDbContext> options, IEntityHistoryRecorder entityHistoryRecorder)
     : base(options)
 {
     _entityHistoryRecorder = entityHistoryRecorder;
 }
示例#2
0
 /// <summary>初始化新的实例</summary>
 /// <param name="options">应用于<see cref="ApplicationDbContext" />的选项</param>
 /// <param name="entityHistoryRecorder">记录实体变更的记录器</param>
 /// <param name="httpContextAccessor">Http上下文访问器</param>
 public ApplicationDbContext(DbContextOptions <ApplicationDbContext> options, IEntityHistoryRecorder entityHistoryRecorder, IHttpContextAccessor httpContextAccessor)
     : base(options)
 {
     _entityHistoryRecorder = entityHistoryRecorder;
     _httpContextAccessor   = httpContextAccessor;
 }