【发布时间】:2020-05-05 14:18:55
【问题描述】:
我正在使用 aspnetboilerplate 并在模块的 preintilize 中添加了以下配置。我还向我的实体添加了经过审计的数据注释,但它仍然无法正常工作。我的实体从 AuditedEntity 继承,因为不需要删除功能。请帮忙
Configuration.EntityHistory.IsEnabled = true; Configuration.EntityHistory.Selectors.Add(new NamedTypeSelector("Abp.AuditedEntities", type => typeof(AuditedEntity).IsAssignableFrom(type)));
我从这里参考了Can't enable Entity History in ASP.NET Zero 下面是实体定义
[Audited]
public partial class QuestionResponse : AuditedEntity<long>
{
public long ApplicationId { get; set; }
public long QuestionId { get; set; }
public string Response { get; set; }
public string Remark { get; set; }
public bool IsActive { get; set; }
public Application Application { get; set; }
public AbpUsers CreatorUser { get; set; }
public AbpUsers LastModifierUser { get; set; }
public Question Question { get; set; }
}
【问题讨论】: