Nfield.Services.Implementation.NfieldSamplingPointInterviewerAssignmentsService.QueryAsync C# (CSharp) Method

QueryAsync() public method

public QueryAsync ( string surveyId, string samplingPointId ) : Task>
surveyId string
samplingPointId string
return Task>
        public Task<IQueryable<InterviewerSamplingPointAssignmentModel>> QueryAsync(string surveyId, string samplingPointId)
        {
            CheckParameters(surveyId, samplingPointId);

            var uri = AssignmentsApi(surveyId, samplingPointId, null).AbsoluteUri;

            return Client.GetAsync(uri)
                 .ContinueWith(
                     responseMessageTask => responseMessageTask.Result.Content.ReadAsStringAsync().Result)
                 .ContinueWith(
                     stringTask =>
                     JsonConvert.DeserializeObject<List<InterviewerSamplingPointAssignmentModel>>(stringTask.Result).AsQueryable())
                 .FlattenExceptions();
        }

Usage Example

 public void TestQueryAsync_SurveyIdIsNull_Throws()
 {
     var target = new NfieldSamplingPointInterviewerAssignmentsService();
     Assert.Throws<ArgumentNullException>(() =>
             UnwrapAggregateException(target.QueryAsync(null, SamplingPointId)));
 }
All Usage Examples Of Nfield.Services.Implementation.NfieldSamplingPointInterviewerAssignmentsService::QueryAsync