Beispiel #1
0
        public IHttpActionResult GetCheckpointListByPlannedRouteId(int id)
        {
            try
            {
                log.Debug("_checkpointService.GetCheckpointListByPlannedRouteId - PlannedRouteId: " + id + " ");

                List <CheckpointViewModel> checkpoints;

                checkpoints = _checkpointService.GetCheckpointListByPlannedRouteId(id)
                              .Select(checkpoint => new CheckpointViewModel(checkpoint, ""))
                              .ToList();

                log.Debug("result: 'success'");

                //return Json(checkpoints, JsonRequestBehavior.AllowGet);
                //return Content(JsonConvert.SerializeObject(checkpoints), "application/json");
                return(Ok(checkpoints));
            }
            catch (Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }