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

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