public async Task <long> UpdateStepAsync(long id, UpdateTrackerStepRequest updateTrackerRequestStep) { if (updateTrackerRequestStep == null) { throw new ArgumentNullException(nameof(updateTrackerRequestStep)); } return(await _trackingRequestService.UpdateStepAsync(id, updateTrackerRequestStep)); }
public async Task <long> UpdateStepAsync(long id, UpdateTrackerStepRequest updateTrackerStepRequest) { if (updateTrackerStepRequest == null) { throw new ArgumentNullException(nameof(updateTrackerStepRequest)); } var trackingRequest = await base.GetOrThrowAsync(id).ConfigureAwait(false); trackingRequest.Status = TrackerRequestStatus.InProgress; trackingRequest.CurrentStep = updateTrackerStepRequest.Step; if (trackingRequest.TotalSteps <= trackingRequest.CurrentStep) { trackingRequest.TotalSteps = trackingRequest.CurrentStep; } trackingRequest.CurrentStepDescription = updateTrackerStepRequest.Description; return(await base.UpdateAsync(id, trackingRequest).ConfigureAwait(false)); }
public async Task <long> UpdateStepAsync(long id, UpdateTrackerStepRequest updateTrackerStepRequest) { return(await Task.FromResult(RestClient.Put <long>(new RestRequest($"{Resource}/step/{id}").AddJsonBody(updateTrackerStepRequest)).Data)); }