Exemplo n.º 1
0
 public Task Handle(PostProductCreatedEvent @event)
 {
     searchesDbContext.Products.Add(new Product
     {
         Name = @event.Name
     });
     searchesDbContext.SaveChanges();
     return(Task.CompletedTask);
 }
 public Task Handle(PostOrderCreatedEvent @event)
 {
     searchesDbContext.Orders.Add(new Order
     {
         OrderDate = @event.OrderDate,
         Total     = @event.Total,
         Items     = @event.Items
     });
     searchesDbContext.SaveChanges();
     return(Task.CompletedTask);
 }
Exemplo n.º 3
0
 public Task Handle(PostCustomerCreatedEvent @event)
 {
     searchesDbContext.Customers.Add(new Customer
     {
         Address    = @event.Address,
         Name       = @event.Name,
         CustomerId = @event.Id
     });
     searchesDbContext.SaveChanges();
     return(Task.CompletedTask);
 }