Exemple #1
0
        public static IDevice Map(ExampleDeviceDTO deviceDTO)
        {
            IDevice device = new ExampleDevice
            {
                Id      = deviceDTO.Id,
                Name    = deviceDTO.Name,
                Enabled = deviceDTO.Enabled
            };

            return(device);
        }
Exemple #2
0
 public async Task <bool> UpdateDevice(int id, ExampleDeviceDTO deviceNewValues)
 {
     return(await Task.FromResult(_repoReference.Update(id, Mapper.Map(deviceNewValues))));
 }
 public async Task <bool> RemoveDeviceFromRoom(RoomDTO referenceRoom, ExampleDeviceDTO newDevice)
 {
     return(await Task.FromResult(_repoReference.RemoveDeviceFromRoom(referenceRoom.Id, Mapper.Map(newDevice))));
 }
Exemple #4
0
 public async Task <bool> AddDevice(ExampleDeviceDTO newDevice)
 {
     return(await Task.FromResult(_repoReference.Add(Mapper.Map(newDevice))));
 }