CodeDocu.com

C #: The return type of async method must be void, Task or Task <T>

 

A common error message in C # when developing asynchronous methods is the message

The return type of an async method must be void, Task or Task<T>

 

 

 

Bad method

public static async User_SumModel get_User_Sums(ClaimsPrincipal parUser)

        {

            //------------< get_User_Sums(User) >------------

       ..

C #: The return type of async method must be void, Task or Task T

 

Solution:

Just a task <..> to write the return type

public static async Task<User_SumModel>  get_User_Sums(ClaimsPrincipal parUser)

        {

            //------------< get_User_Sums(User) >------------

            //*get User Summary Table

            User_SumModel summary = new User_SumModel();

 

C #: The return type of async method must be void, Task or Task T


Software Entwicklung Stuttgart NĂ¼rtingen
Suche Projekte C#, WPF, Windows App,ASP.Net, vb.Net, WinForms, SQL Server, Access, Excel