コード例 #1
0
        public async Task <IActionResult> Patch([FromBody] Device device)
        {
            if (device == null)
            {
                return(Ok(new
                {
                    correct = false,
                    title = "Petición inválida.",
                    message = "No se permite enviar solicitud vacía",
                    deviceData = device,
                    fullStackTrace = "",
                }));
            }
            var response = await devicesRepository.TurnOnOffDevice(device);

            return(Ok(new
            {
                correct = false,
                title = "Petición inválida.",
                message = "No se permite enviar solicitud vacía",
                deviceData = response,
                fullStackTrace = "",
            }));
        }