예제 #1
0
 public ActionResult Create(CreateViewModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             var command = new AddProductToCatalog(Guid.NewGuid(), model.ProductName, model.UnitPrice, model.QuantityPerUnit);
             Bus.Send(command);
             return(RedirectToAction("Index"));
         }
         catch
         {
             return(View());
         }
     }
     else
     {
         return(View(model));
     }
 }
예제 #2
0
 public void Handle(AddProductToCatalog message)
 {
 }