Answers for "Cannot implicitly convert type 'int' to 'System.Threading.Tasks.Task<int>'"

C#
1

Cannot implicitly convert type 'int' to 'System.Threading.Tasks.Task<int>'

int count;
// use Task.FromResult with retuned value
return Task.FromResult(count);

// Or make your method async, and await the returned value
private async Task<int> ReturnInterger(){}

// Or take care of it while declaring the variable
var count = Task<int>;
Posted by: Guest on January-20-2021

Code answers related to "Cannot implicitly convert type 'int' to 'System.Threading.Tasks.Task<int>'"

C# Answers by Framework

Browse Popular Code Answers by Language