Exemplo n.º 1
0
 public void CustomerMovingToNewAddress(MoveCustomerToNewAddress command)
 {
     ApplyChange(new CustomerMovedToNewAddress
     {
         City        = command.City,
         CustomerId  = command.CustomerId,
         HouseNumber = command.HouseNumber,
         State       = command.State,
         Street      = command.Street,
         Zip         = command.Zip,
     });
 }
Exemplo n.º 2
0
 public ActionResult Create(MoveCustomerToNewAddress command, FormCollection collection)
 {
     try
     {
         var customerId = Guid.Parse(collection.Get("CustomerId"));
         command.CustomerId = customerId;
         _serviceBus.Send(command);
         return(RedirectToAction("Index", "Customer"));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("Exception", ex.Message);
         return(View("Create"));
     }
 }