Exemplo n.º 1
0
 public Task HandleAsync(ICommandContext context, PlaceOrder command)
 {
     return(context.AddAsync(new Order(
                                 command.AggregateRootId,
                                 command.ConferenceId,
                                 command.Seats.Select(x => new SeatQuantity(new SeatType(x.SeatType, x.SeatName, x.UnitPrice), x.Quantity)),
                                 _pricingService)));
 }
Exemplo n.º 2
0
 public Task HandleAsync(ICommandContext context, CreatePayment command)
 {
     return(context.AddAsync(new Payment(
                                 command.AggregateRootId,
                                 command.OrderId,
                                 command.ConferenceId,
                                 command.Description,
                                 command.TotalAmount,
                                 command.Lines.Select(x => new PaymentItem(x.Description, x.Amount)).ToList())));
 }
Exemplo n.º 3
0
 public Task HandleAsync(ICommandContext context, StartTransferTransactionCommand command)
 {
     return(context.AddAsync(new TransferTransaction(command.AggregateRootId, command.TransactionInfo)));
 }
Exemplo n.º 4
0
 public Task HandleAsync(ICommandContext context, StartDepositTransactionCommand command)
 {
     return(context.AddAsync(new DepositTransaction(command.AggregateRootId, command.AccountId, command.Amount)));
 }
 public Task HandleAsync(ICommandContext context, CreateAccountCommand command)
 {
     return(context.AddAsync(new BankAccount(command.AggregateRootId, command.Owner)));
 }
Exemplo n.º 6
0
 public Task HandleAsync(ICommandContext context, CreateNoteCommand command)
 {
     return(context.AddAsync(new Note(command.AggregateRootId, command.Title)));
 }
Exemplo n.º 7
0
 public Task HandleAsync(ICommandContext context, CreateSectionCommand command)
 {
     return(context.AddAsync(new Section(command.AggregateRootId, command.Name, command.Description)));
 }
Exemplo n.º 8
0
 public Task HandleAsync(ICommandContext context, CreatePostCommand command)
 {
     return(context.AddAsync(new Post(command.AggregateRootId, command.Subject, command.Body, command.SectionId, command.AuthorId)));
 }