public virtual ApiDeviceServerResponseModel MapEntityToModel( Device item) { var model = new ApiDeviceServerResponseModel(); model.SetProperties(item.Id, item.DateOfLastPing, item.IsActive, item.Name, item.PublicId); return(model); }
public virtual ApiDeviceServerResponseModel MapServerRequestToResponse( int id, ApiDeviceServerRequestModel request) { var response = new ApiDeviceServerResponseModel(); response.SetProperties(id, request.DateOfLastPing, request.IsActive, request.Name, request.PublicId); return(response); }
public virtual ApiDeviceActionServerResponseModel MapEntityToModel( DeviceAction item) { var model = new ApiDeviceActionServerResponseModel(); model.SetProperties(item.Id, item.Action, item.DeviceId, item.Name); if (item.DeviceIdNavigation != null) { var deviceIdModel = new ApiDeviceServerResponseModel(); deviceIdModel.SetProperties( item.DeviceIdNavigation.Id, item.DeviceIdNavigation.DateOfLastPing, item.DeviceIdNavigation.IsActive, item.DeviceIdNavigation.Name, item.DeviceIdNavigation.PublicId); model.SetDeviceIdNavigation(deviceIdModel); } return(model); }