コード例 #1
0
        public HttpResponseMessage GetObservation(int id)
        {
            if (loggedUserId == null)
            {
                //TODO: you are not logged message here
                return(Request.CreateResponse(HttpStatusCode.Unauthorized, "err niezalogowany"));
            }

            var observation = _observationRepository.GetObservation(id).FirstOrDefault();

            if (observation == null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, "err Observation nie istenieje"));
            }

            var result = new ObservationVm(observation);

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }