public QueryAsync ( string surveyId, int languageId ) : Task |
||
surveyId | string | |
languageId | int | |
리턴 | 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();
}
public void TestQueryAsync_SurveyIdIsNull_Throws() { var target = new NfieldTranslationsService(); Assert.Throws<ArgumentNullException>(() => UnwrapAggregateException(target.QueryAsync(null, 0))); }