I have an EF model like this:
public class Test : AuditedAggregateRoot<Guid>, IMultiTenant, IProcessibleType
{
public IList<Test> EventHistory { get; set; }
private readonly IGuidGenerator _guidGenerator;
public Guid? TenantId { get; set; }
public Status Status { get { return this._Status; }
set {
if(this._Status != value)
{
this.AddEventHistory(EventType.StatusChange, $"Status updated from {this._Status} to {value}.", null);
this._Status = value;
}
} }
public void AddEventHistory(EventType eventType, string description)
{
var event = new Test(_guidGenerator.Create(), this.Id, eventType, description);
this.EventHistory.Add(event);
}
}
As you can see, I tried to use _guidGenerator.Create(), but this always returns a null exception; how can I use an ABP guid generator on an EF entity?
An
AggregateRootshould not have a reference to anIGuidGenerator.Use a
DomainService:Usage: