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

QueryAsync() public method

See INfieldTranslationsService.QueryAsync
public QueryAsync ( string surveyId, int languageId ) : Task>
surveyId string
languageId int
return Task>
        public Task<IQueryable<Translation>> QueryAsync(string surveyId, int languageId)
        {
            CheckSurveyId(surveyId);

            return Client.GetAsync(TranslationsApi(surveyId, languageId, null).AbsoluteUri)
                         .ContinueWith(
                             responseMessageTask => responseMessageTask.Result.Content.ReadAsStringAsync().Result)
                         .ContinueWith(
                             stringTask =>
                             JsonConvert.DeserializeObject<List<Translation>>(stringTask.Result).AsQueryable())
                         .FlattenExceptions();
        }

Usage Example

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