public JsonPatchDocument <ApiDeviceActionRequestModel> CreatePatch(ApiDeviceActionRequestModel model) { var patch = new JsonPatchDocument <ApiDeviceActionRequestModel>(); patch.Replace(x => x.DeviceId, model.DeviceId); patch.Replace(x => x.Name, model.Name); patch.Replace(x => x.@Value, model.@Value); return(patch); }
public virtual ApiDeviceActionRequestModel MapResponseToRequest( ApiDeviceActionResponseModel response) { var request = new ApiDeviceActionRequestModel(); request.SetProperties( response.DeviceId, response.Name, response.@Value); return(request); }
public virtual ApiDeviceActionResponseModel MapRequestToResponse( int id, ApiDeviceActionRequestModel request) { var response = new ApiDeviceActionResponseModel(); response.SetProperties(id, request.DeviceId, request.Name, request.@Value); return(response); }