public async Task <IActionResult> Edit(List <PgreDB.Models.AllInfoPvPlantV> Model) { if (ModelState.IsValid) { if (Model.Count != 0) { foreach (AllInfoPvPlantV item in Model) { PowerPlant tmpPP = _context.PowerPlants.Find(item.PowerPlantId); tmpPP.Name = item.EromuNeve; tmpPP.LocationCity = item.LocationCity; if (item.LocationParcelNumber != null) { tmpPP.LocationParcelNumber = item.LocationParcelNumber; } else { tmpPP.LocationParcelNumber = ""; } tmpPP.LocationParcelNumber = item.LocationParcelNumber; PvPlantPhysical tmpPPP = _context.PvPlantPhysicals .Where(b => b.PowerPlantId == item.PowerPlantId) .FirstOrDefault(); _context.Update(tmpPP); _context.Update(tmpPPP); } await _context.SaveChangesAsync(); } } return(RedirectToAction("Index")); }
public async Task <IActionResult> Edit(List <AllInfoWindParkV> Model) { foreach (AllInfoWindParkV item in Model) { _context.Update(item); } await _context.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <IActionResult> Edit(List <PgreDB.Models.Testtabla> Model) { if (Model.Count != 0) { foreach (Testtabla item in Model) { _context.Update(item); } await _context.SaveChangesAsync(); } return(RedirectToAction("Index")); }