Esempio n. 1
0
        public HttpResponseMessage GetObjectives(string id)
        {
            try
            {
                var objectives = _objectiveService.GetAllObjectives(id).ToList();
                if (objectives.Count == 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, "No entries yet!"));
                }

                return(Request.CreateResponse(HttpStatusCode.OK, objectives));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }