public async Task HandleAsync( AuditDomainEvent <IAudit> args) { await _context.Set <Audit>().AddAsync(new Audit(args.Action, args.Audit)); await _context.SaveChangesAsync(); }
public EmployeeRecord Create() { var employeeRecord = EmployeeRecord.Create("Freshly created employeeRecord"); employeeRecord.DomainEvents.Add(AuditDomainEvent.Create("Created")); _efContext.EmployeeRecord.Add(employeeRecord); _efContext.SaveChanges(); return(employeeRecord); }
public void Delete() { DomainEvents.Add(AuditDomainEvent.Create("Deleted")); IsDeleted = true; }
public void Update(string description) { DomainEvents.Add(AuditDomainEvent.Create("Updated")); Description = description; }