I have a Portable Class Library (PCL) method like this:
public async Task GetLineStatuses()
{
HttpWebRequest request = (HttpWebRequest)WebReque
Async and await are perfectly acceptable in ASP.NET. Here's a Scott Handselman video demoing it: http://www.asp.net/vnext/overview/aspnet/async-and-await
"Also would I have the same effect if I returned Task
rather than Task
?"
Not really sure what you mean by this. The Task is like a container for the object, so a Task
would contain your string result and a Task
would contain your HttpResponseMessage result... Is that what you mean? I think either method is perfectly acceptable. If you just need the string, then go with that. No point in returning more than you need.