이 코드asynс 작업과 Task 만 사용하는 것의 차이점은 무엇입니까? 예를 들어
public Task<IList<NewsSentimentIndexes>> GetNewsSentimentIndexes(DateTime @from, DateTime to = new DateTime(), string grouping = "1h")
{
var result = _conf.BasePath
.AppendPathSegment("news-sentiment-indexes")
.SetQueryParams(new
{
from = from.ToString("s"),
to = to.ToString("s"),
grouping
});
return result
.GetStringAsync()
.ContinueWith(Desereialize<IList<NewsSentimentIndexes>>);
}
하나가 올바른지 또는 빠르게 작동하는지
public async Task<IList<NewsSentimentIndexes>> GetNewsSentimentIndexes(DateTime @from, DateTime to = new DateTime(), string grouping = "1h")
{
var result = _conf.BasePath
.AppendPathSegment("news-sentiment-indexes")
.SetQueryParams(new
{
from = from.ToString("s"),
to = to.ToString("s"),
grouping
});
var newsStr = await result.GetStringAsync();
return JsonConvert.DeserializeObject<NewsSentimentIndexes>(newsStr);
}
차이? 그냥이 메서드를 호출하거나 기다릴 필요가 있을까요?
WaitAll과 계속되는 법을 알려주십시오. DateTime.Now) .ContinueWith (ContinuationAction), _tradingPairService.GetAllExchangeTradingPairAsync (ExchangeId, TradingPairId : 그것은 await를 –
'Task.WaitAll ( _newsService.GetAll (DateTime.Now.AddYears (-1)에를 사용하는 것이 불가능하다) .ContinueWith (ContinuationAction), _companyTypesService.GetAll(). ContinueWith (ContinuationAction)); ' –
나는 당신의 블로그를 읽어 주셔서 감사합니다. 그러나 동일한 작업으로 WaitAll 예제가 필요합니다. 동일의 계속과 함께 –