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

QueryAsync() public method

INfieldSurveyResponseCodesService.QueryAsync(string)
public QueryAsync ( string surveyId ) : Task>
surveyId string
return Task>
        public Task<IQueryable<SurveyResponseCode>> QueryAsync(string surveyId)
        {
            if (string.IsNullOrEmpty(surveyId))
            {
                throw new ArgumentNullException("surveyId");
            }
            var uri = SurveyResponseCodeUrl(surveyId, null);

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

Same methods

NfieldSurveyResponseCodesService::QueryAsync ( string surveyId, int code ) : Task

Usage Example

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