public void DeleteCity(DeleteCityRequest request) { if (request != null) { var dataAccess = new CityDataAccess(request.Context); var city = dataAccess.GetById(request.IdCity); dataAccess.Delete(city.FirstOrDefault()); } }
public City GetCityById(GetCityByIdRequest request) { City city = null; if (request != null) { var dataAccess = new CityDataAccess(request.Context); var cityQuery = dataAccess.GetById(request.IdCity); cityQuery = cityQuery.Include(c => c.State); city = cityQuery.FirstOrDefault(); } return(city); }
public ActionResult Delete(int id) { return(View(CityDataAccess.GetById(id))); }
public ActionResult Edit(int id) { ViewBag.ProvinceList = new SelectList(ProvinceDataAccess.GetAll(), "Code", "Name"); return(View(CityDataAccess.GetById(id))); }