Ejemplo n.º 1
0
        public async Task <ActionResult <Cataloges> > DeleteCataloges(int id)
        {
            var cataloges = await _context.Cataloges.FindAsync(id);

            if (cataloges == null)
            {
                return(NotFound());
            }
            string remember_token = HttpContext.Request.Headers["Authorization"];
            var    token          = new JwtSecurityTokenHandler().ReadJwtToken(remember_token);
            var    username       = token.Claims.First(claim => claim.Type == "username").Value;

            _catalogesRepository.RemoveCataloges(id, username);
            return(NoContent());
        }
Ejemplo n.º 2
0
 public ActionResult RemoveCataloges(int id, string username)
 {
     _catalogesRepository.RemoveCataloges(id, username);
     return(NoContent());
 }