private Response GetAllLocations() { if (mIsDebug) { Console.WriteLine("GET: /rest/v1/locations"); } return(Response.AsJson(DTOConverter.ToDTO(_locationRepository.GetList()))); }
private Response GetLocation(int locationId) { if (mIsDebug) { Console.WriteLine("GET: /rest/v1/locations/{locationid}"); Console.WriteLine("locationid={0}", locationId); } var location = _locationRepository.GetById(locationId); if (location != null) { return(Response.AsJson(DTOConverter.ToDTO(location))); } return(HttpStatusCode.NotFound); }