public IActionResult RemoveCategory(CategoryModel category) { int?mateID = ClaimHelper.GetIdFromClaimIdentity((ClaimsIdentity)this.ControllerContext.HttpContext.User.Identity); if (mateID == null) { return(Unauthorized(new ErrorMessageModel("Utilizador não existe!"))); } MateDAO mateDAO = new MateDAO(_connection); mateDAO.RemoveCategory((int)mateID, category); return(Ok(new SuccessMessageModel("Apagado!"))); }