public IActionResult Delete(int id) { var gram = grams.Get(id); if (gram != null) { return(NotFound()); } grams.Delete(id); return(Ok()); }
public async Task <IActionResult> OnPostDelete() { await _post.Delete(ID.Value); return(RedirectToPage("/Index")); }