Exemplo n.º 1
0
 private void HandleEvent(BookDeleteEvent domainEvent)
 {
     using (QueryDBEntities _dbContext = new QueryDBEntities())
     {
         Book book = _dbContext.Book.FirstOrDefault(t => t.AggregateRootId == domainEvent.AggregateRootId);
         _dbContext.Entry(book).State = EntityState.Deleted;
         _dbContext.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void HandleEvent(BookDeleteEvent e)
 {
     this.AggregateRootId = Guid.Empty;
     this.Title           = null;
     this.Author          = null;
     this.Description     = null;
     this.ISBN            = null;
     this.Pages           = 0;
     this.Inventory       = 0;
 }