Example #1
0
        private Response GetAllLocations()
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/locations");
            }

            return(Response.AsJson(DTOConverter.ToDTO(_locationRepository.GetList())));
        }
Example #2
0
        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);
        }