Exemple #1
0
        public IActionResult GetById(int id)
        {
            if (id == 0)
            {
                return(BadRequest());
            }
            var userFound = userBLL.Find(id);

            if (userFound == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(userFound));
        }
Exemple #2
0
 private User GetUser(int userId)
 {
     try
     {
         return(userBll.Find(userId));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }