Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

async method out parameter c#

// NOTE: You can't have async methods with ref or out parameters.

public async Task Method1()
{
    var result = await TestAsync();
    int code = result.successCode;
    bool error = tuple.error;
}

// A workaround for this is to just return a tuple 
public async Task<(int successCode, bool error)> TestAsync()
{
    //...
    return (1, true);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: pyqt send message to another instance 
Csharp :: autho close in persian time picker 
Csharp :: index sort 
Csharp :: office open xml check if row is empty 
Csharp :: array of objects c# 
Csharp :: c# get error message from cmd command 
Csharp :: mysql executeScalar only if successful 
Csharp :: Query Parent-GrandChild collection 
Csharp :: how to controller request in c# 
Csharp :: crystal report error webconfig reference 
Csharp :: quick watch in visual studio 
Csharp :: vb.net delete line from text file 
Csharp :: C# calling method name 
Csharp :: how download file from internet and move it to folder with c# 
Csharp :: ${1##*[! ]} 
Csharp :: jittery movement unity 
Csharp :: salary, overtime, deductions, gross pay and netpay in console C# 
Csharp :: Delegate no parameter no return 
Csharp :: store file in DB 
Csharp :: c# rotate sum array 
Csharp :: world space constant size 
Csharp :: how to make physics in unity 
Csharp :: Appending to an Existing CSV File with csvhelper 
Csharp :: SonarQube UnitTests 
Csharp :: asp net route attribute vs httpget 
Csharp :: Diplay player final score in new scene in unity 
Csharp :: ASP.NET Web Forms TextBox 
Csharp :: unity sprite blurry when far 
Csharp :: Enum into table C# 
Csharp :: how to take previous record in linq c# 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =