Nfield.Services.Implementation.NfieldSurveyRelocationsService.QueryAsync C# (CSharp) 메소드

QueryAsync() 공개 메소드

See INfieldSurveyRelocationsService.QueryAsync
public QueryAsync ( string surveyId ) : Task>
surveyId string
리턴 Task>
        public Task<IQueryable<SurveyRelocation>> QueryAsync(string surveyId)
        {
            CheckSurveyId(surveyId);

            return Client.GetAsync(RelocationsApi(surveyId).AbsoluteUri)
                         .ContinueWith(
                             responseMessageTask => responseMessageTask.Result.Content.ReadAsStringAsync().Result)
                         .ContinueWith(
                             stringTask =>
                             JsonConvert.DeserializeObject<List<SurveyRelocation>>(stringTask.Result).AsQueryable())
                         .FlattenExceptions();
        }

Usage Example

 public void TestQueryAsync_SurveyIdIsEmpty_Throws()
 {
     var target = new NfieldSurveyRelocationsService();
     Assert.Throws<ArgumentException>(() => UnwrapAggregateException(target.QueryAsync("")));
 }
All Usage Examples Of Nfield.Services.Implementation.NfieldSurveyRelocationsService::QueryAsync