Esempio n. 1
0
        public async Task <IActionResult> DeleteDeviceAttribute(int id)
        {
            var deviceAttributeFromRepo = await _repo.GetDeviceAttribute(id);

            if (deviceAttributeFromRepo == null)
            {
                return(BadRequest($"DeviceAttributeId {id} could not be found"));
            }

            _repo.Delete(deviceAttributeFromRepo);

            if (await _repo.SaveAll())
            {
                return(Ok());
            }

            return(BadRequest("Failed to delete device note"));
        }