public async Task <IActionResult> Edit(int id, [Bind("ID,Image,SectorName,SectorCategory,Label,User,History")] FlomakSector flomakSector) { if (id != flomakSector.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(flomakSector); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FlomakSectorExists(flomakSector.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(flomakSector)); }
public async Task <IActionResult> Create([Bind("ID,Image,SectorName,SectorCategory,Label,User,History")] FlomakSector flomakSector) { if (ModelState.IsValid) { _context.Add(flomakSector); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(flomakSector)); }