public ActionResult Create(AnimalVM animalVM)
        {
            if (animalVM.Id > 0)
                WebApiClient.Build().Put(EndPoints.Animals, animalVM.Id, animalVM);
            else
                WebApiClient.Build().Post(EndPoints.Animals, animalVM);

            return RedirectToAction("List");
        }
        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(int?id)
        {
            CityVM city = new CityVM();

            if (id != null)
            {
                city = WebApiClient.Build().Get <CityVM>(EndPoints.Cities, id);
            }

            return(View(city));
        }
        public ActionResult Create(int? id)
        {
            AnimalVM animal = new AnimalVM();
            animal.Races = WebApiClient.Build().Get<List<RaceVM>>(EndPoints.Races, null);

            if (id != null)
            {
                animal = WebApiClient.Build().Get<AnimalVM>(EndPoints.Animals, id);
            }

            return View(animal);
        }
        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"));
        }
        public ActionResult Create(CityVM cityVM)
        {
            if (cityVM.Id > 0)
            {
                WebApiClient.Build().Put(EndPoints.Cities, cityVM.Id, cityVM);
            }
            else
            {
                WebApiClient.Build().Post(EndPoints.Cities, cityVM);
            }

            return(RedirectToAction("List"));
        }
        public ActionResult Delete(int id)
        {
            WebApiClient.Build().Delete <RaceVM>(EndPoints.Races, id);

            return(RedirectToAction("List"));
        }
        // GET: Race
        public ActionResult List()
        {
            List <RaceVM> races = WebApiClient.Build().Get <List <RaceVM> >(EndPoints.Races, null);

            return(View(races));
        }
        public ActionResult Delete(int id)
        {
            WebApiClient.Build().Delete<AnimalVM>(EndPoints.Animals, id);

            return RedirectToAction("List");
        }
 // GET: Animal
 public ActionResult List()
 {
     List<AnimalVM> animalVMs = WebApiClient.Build().Get<List<AnimalVM>>(EndPoints.Animals, null);
     return View(animalVMs);
 }
        // GET: City
        public ActionResult List()
        {
            List <CityVM> cities = WebApiClient.Build().Get <List <CityVM> >(EndPoints.Cities, null);

            return(View(cities));
        }