public async Task <IActionResult> Edit(int id, [Bind("Id,NomDetail,Description")] DetailsArchitecture detailsArchitecture) { if (id != detailsArchitecture.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(detailsArchitecture); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DetailsArchitectureExists(detailsArchitecture.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(detailsArchitecture)); }
public async Task <IActionResult> Create([Bind("Id,NomDetail,Description")] DetailsArchitecture detailsArchitecture) { if (ModelState.IsValid) { _context.Add(detailsArchitecture); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(detailsArchitecture)); }