public ApplicationDbContext(DbContextOptions <ApplicationDbContext> options, IEntityHistoryRecorder entityHistoryRecorder) : base(options) { _entityHistoryRecorder = entityHistoryRecorder; }
/// <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; }