public async Task <ActionResult> Delete(int id) { try { // TODO: Add delete logic here await _repo.DeleteExampleAsync(id, User.Identity.Name); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public async Task <IActionResult> Delete(int Id) => Ok(await _repo.DeleteExampleAsync(Id, User.FindFirst("uid")?.Value).ConfigureAwait(false));