Exemplo n.º 1
0
        public ActionResult Create(int?id)
        {
            RaceVM race = new RaceVM();

            if (id != null)
            {
                race = WebApiClient.Build().Get <RaceVM>(EndPoints.Races, id);
            }

            return(View(race));
        }
Exemplo n.º 2
0
        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"));
        }