public Device Add(Device device)
        {
            this.devices.Add(device);
            this.devices.SaveChanges();

            return device;
        }
        public Device Update(int id, Device device)
        {
            var deviceToUpdate = this.devices.GetById(id);
            deviceToUpdate.Name = device.Name;
            deviceToUpdate.CategoryId = device.CategoryId;
            this.devices.SaveChanges();

            return deviceToUpdate;
        }