コード例 #1
0
        public async Task <long> UpdateStepAsync(long id, UpdateTrackerStepRequest updateTrackerRequestStep)
        {
            if (updateTrackerRequestStep == null)
            {
                throw new ArgumentNullException(nameof(updateTrackerRequestStep));
            }

            return(await _trackingRequestService.UpdateStepAsync(id, updateTrackerRequestStep));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: Tracker.cs プロジェクト: nikhilsarvaiye/TrackingApi
 public async Task <long> UpdateStepAsync(long id, UpdateTrackerStepRequest updateTrackerStepRequest)
 {
     return(await Task.FromResult(RestClient.Put <long>(new RestRequest($"{Resource}/step/{id}").AddJsonBody(updateTrackerStepRequest)).Data));
 }