Esempio n. 1
0
        public async Task HandleAsync(
            AuditDomainEvent <IAudit> args)
        {
            await _context.Set <Audit>().AddAsync(new Audit(args.Action, args.Audit));

            await _context.SaveChangesAsync();
        }
Esempio n. 2
0
        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;
 }