public async Task <IActionResult> Create([FromBody] AddCityInputDto addinput) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await CityService.Addcity(addinput); return(Ok(result)); }
/* * make for postman */ public async Task <string> Addcity(AddCityInputDto addinput) { var findCountry = await FindCountry(addinput.Country); await IsReapited(addinput.City); var newcity = new City() { Image = addinput.Image, Name = addinput.City, CountryId = findCountry.Id }; CityRepository.Insert(newcity); await CityRepository.Save(); return("We add your city.."); }