public ActionResult Create(int?id) { RaceVM race = new RaceVM(); if (id != null) { race = WebApiClient.Build().Get <RaceVM>(EndPoints.Races, id); } return(View(race)); }
public ActionResult Create(RaceVM raceVM) { if (raceVM.Id > 0) { WebApiClient.Build().Put(EndPoints.Races, raceVM.Id, raceVM); } else { WebApiClient.Build().Post(EndPoints.Races, raceVM); } return(RedirectToAction("List")); }