public ActionResult GetAllListsByUser() { try { var userName = this.User.Identity.Name; if (this.User.Identity.IsAuthenticated && userName != null) { var result = _listRepository.GetAllListsByUserName(userName); return(Ok(result)); } else { return(this.StatusCode(StatusCodes.Status401Unauthorized, "Unauthorized request")); } } catch (Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } }