public async Task <CountryDetailsModel> GetCountry(int countryId) { CountryDetailsDto countryDetailsDto = await _countryService.GetCountryAsync(countryId); CountryDetailsModel countryDetailsModel = _mapper.Map <CountryDetailsModel>(countryDetailsDto); return(countryDetailsModel); }
public ActionResult EditCountry(CountryDetailsModel model) { if (!ModelState.IsValid) { return(View(model)); } var countryDto = Mapper.Map <CountryDto>(model); _countryService.EditCountry(countryDto); return(Redirect("CountryList")); }
public ActionResult Details(int id) { var country = _context.Countries.FirstOrDefault(c => c.Id == id); var model = new CountryDetailsModel { Id = country.Id, Name = country.Name, DateCreate = country.DateCreate, Priority = country.Priority }; return(View(model)); }