コード例 #1
0
        private Response GetControllers()
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/controllers");
            }

            return(Response.AsJson(ControllerDTOConverter.ToDTO(_controllerRepository.GetControllers())));
        }
コード例 #2
0
        private Response GetControllers(int locationId)
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/locations/{locationid}/controllers");
                Console.WriteLine("locationid={0}", locationId);
            }

            return(Response.AsJson(ControllerDTOConverter.ToDTO(_locationRepository.GetControllers(locationId))));
        }
コード例 #3
0
        private Response GetController(int locationId, long imei)
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/locations/{locationid}/controllers/{imei}");
                Console.WriteLine("locationid={0}, imei={1}", locationId, imei);
            }

            var controller = FindController(locationId, imei);

            if (controller != null)
            {
                return(Response.AsJson(ControllerDTOConverter.ToDTO(controller)));
            }

            return(HttpStatusCode.NotFound);
        }
コード例 #4
0
        private Response GetController(long imei)
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/controllers/{imei}");
                Console.WriteLine("imei={0}", imei);
            }
            Console.WriteLine("GET: /rest/v1/controllers/{imei}");
            Console.WriteLine("imei={0}", imei);

            var controller = _controllerRepository.Find(imei);

            if (controller == null)
            {
                return(HttpStatusCode.NotFound);
            }

            return(Response.AsJson(ControllerDTOConverter.ToDTO(controller)));
        }