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

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