protected void Delete_Click(object sender, EventArgs e) { Link link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId)); LinkRepository.Delete(link); Response.Redirect(Cancel.NavigateUrl); }
public IActionResult Delete(string id) { Link link = _context.Link.Where(l => l.Id.Equals(id)).FirstOrDefault(); if (link != null) { return(new JsonResult(_linkRepo.Delete(link))); } return(null); }
public IActionResult Delete(int id) { var currentUser = GetCurrentUserProfile(); var link = _linkRepository.GetById(id); if (link.UserProfileId != currentUser.Id) { return(Unauthorized()); } _linkRepository.Delete(link); return(NoContent()); }
public Task Delete(Guid id) => linkRepository.Delete(id);