public async Task <ActionResult> Delete(string id) { var item = await _itemDbCommand.FindAsync(id); if (item == null) { return(HttpNotFound()); } if (item.Author != LogonUser) { return(new HttpUnauthorizedResult()); } await _itemDbCommand.DeleteAsync(item.Id); return(RedirectToAction("Index", "Item")); }