For example, the difference between this code
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>>);
}
and that
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);
}
Which one is correct or faster working? And just call this method need to await or just a task?