public void CityListTest() { BusinessLogic businessLogic = new BusinessLogic(); CountryModelForId countryModel = new CountryModelForId { CountryId = 1, }; var citytList = businessLogic.ShowCityByCountryId(countryModel); Assert.IsNotNull(countryModel); }
public List <City> ShowCityByCountryId(CountryModelForId countryModelForId) { List <City> city = _db.Cities.Where(x => x.Country_Id == countryModelForId.CountryId).ToList(); return(city); }
public IHttpActionResult ShowCityByCountryId([FromBody] CountryModelForId countryModelForId) { return(Ok(_businessLogic.ShowCityByCountryId(countryModelForId))); }