public ActionResult Create(Vehicle v) { try { var request = new AddVehicleForCustomer() { Brand = v?.Brand, LicenseNumber = v?.LicenseNumber, OwnerId = v.OwnerId, Type = v?.Type }; mediator.Send(request); return(RedirectToAction(nameof(Index), new { id = v.OwnerId })); } catch { return(View()); } }
public ActionResult AddVehicle(AddVehicleForCustomer command) { mediator.Send(command); return(Ok()); }