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)); } }
public void Handle(AddProductToCatalog message) { }