Esempio n. 1
0
        public ActionResult <Keep> GetById(int id)
        {
            try
            {
                Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier);
                if (user == null)
                {
                    return(Ok(_ks.GetByIdPublic(id)));
                }

                return(Ok(_ks.GetById(user.Value, id)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }