public CountryViewModel All() { CountryViewModel countryViewModel = new CountryViewModel(); countryViewModel.Countries = _countryRepo.Read(); return(countryViewModel); }
public CountryViewModel All() { CountryViewModel cvm = new CountryViewModel(); cvm.CountryList = _countryRepo.Read(); return(cvm); }
public City Add(CreateCityViewModel createCity) { City city = new City(); city.CityName = createCity.cityName; city.CountryNationsName = _countryRepo.Read(createCity.NationsId); city = _cityRepo.Create(city); return(city); }
public City Add(CreateCityViewModel createCity) { //create city City city = new City(); city.Name = createCity.Name; city.Nation = _countryRepo.Read(createCity.NationId); city = _cityRepo.Create(city); //update Country with city --should not be needed //Country countryToUpdate = _countryRepo.Read(city.Nation.Id); //if (countryToUpdate != null) //{ // _countryRepo.Read(createCity.NationId).Cities.Add(city); //} return(city); }
public City Add(CreateCity createCity) { City city = new City(); city.CityName = createCity.CityName; city.Country = _countryRepo.Read(createCity.CountryId); return(_cityRepo.Create(city)); }
public City Add(CreateCity createCity) // CreateCity is the class, createCity is the ViewModel { City city = new City(); // A "blank" city is created city.CityName = createCity.CityName; // In this section add additional validations and checks // city.PersonInQuestion = _peopleRepo.Read(createCity.PersonInQuestionId); // Using peopleRepo and the PersonInQuestionId to put in the right city based on the Id city.Country = _countryRepo.Read(createCity.CountryId); return(_cityRepo.Create(city)); }
public List <Country> All() { return(_countryRepo.Read()); }