private Response GetControllers() { if (mIsDebug) { Console.WriteLine("GET: /rest/v1/controllers"); } return(Response.AsJson(ControllerDTOConverter.ToDTO(_controllerRepository.GetControllers()))); }
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)))); }
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); }
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))); }