Answers for "cannot implicitly convert type to system.threading.task"

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
0

cannot implicitly convert type 'system.threading.tasks.task string ' to 'string' c#

public List<int> TestGetMethod()  
{  
    return GetIdList().Result;  
}
Posted by: Guest on October-20-2020

Code answers related to "cannot implicitly convert type to system.threading.task"

C# Answers by Framework

Browse Popular Code Answers by Language