public IActionResult Create(TypeExigeance item) { _context.TypeExigeance.Add(item); _context.SaveChanges(); return(CreatedAtRoute("GetTypeExigeance", new { id = item.TypeExigeanceID }, item)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } TypeExigeance = await _context.TypeExigeance.FirstOrDefaultAsync(m => m.TypeExigeanceID == id); if (TypeExigeance == null) { return(NotFound()); } return(Page()); }
public IActionResult Update(long id, TypeExigeance item) { var TypeExigeance = _context.TypeExigeance.Find(id); if (TypeExigeance == null) { return(NotFound()); } TypeExigeance.nom = item.nom; _context.TypeExigeance.Update(TypeExigeance); _context.SaveChanges(); return(NoContent()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } TypeExigeance = await _context.TypeExigeance.FindAsync(id); if (TypeExigeance != null) { _context.TypeExigeance.Remove(TypeExigeance); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }