Ejemplo n.º 1
0
    protected void Delete_Click(object sender, EventArgs e)
    {
        Link link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId));

        LinkRepository.Delete(link);
        Response.Redirect(Cancel.NavigateUrl);
    }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
 public Task Delete(Guid id) => linkRepository.Delete(id);