I am trying to return Task paremeter in a function that uses async function and got in trouble.
Here is my code:
private async Task<int> GetIntAsync()
{
return Task<int>.Factory.StartNew(async () =>
{
await func();
some code..
return 123;
});
}
I get the error: "cannot convert async lambda expression to delegate type"..
Is there any way to do call the async functnion from the new task?
await func();out of theStartNewmethod?