public async Task <ActionResult> Edit([Bind(Include = "CountryId,Name,Code2,Code3")] Countries countries) { if (ModelState.IsValid) { _db.Entry(countries).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(countries)); }
public async Task <ActionResult> Edit([Bind(Include = "WeatherConditionId,ExternalId,Description")] WeatherConditions weatherConditions) { if (ModelState.IsValid) { _db.Entry(weatherConditions).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(weatherConditions)); }
public async Task <ActionResult> Edit([Bind(Include = "CityId,CountryId,CityName,ExternalId,Longitude,Latitude")] Cities cities) { if (ModelState.IsValid) { _db.Entry(cities).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.CountryId = new SelectList(_db.Countries, "CountryId", "Name", cities.CountryId); return(View(cities)); }