3 ms·
Define your method like this: public Task<MyResult> ExecuteDatabaseQueryAsync() { return yourDbObject.SomeMethodAsync(); } ... MyResult result =
by nathanaldensr 10y ago
Define your method like this:
public Task<MyResult> ExecuteDatabaseQueryAsync()
{
return yourDbObject.SomeMethodAsync();
}
...
MyResult result = await ExecuteDatabaseQueryAsync();
The actual code in ExecuteDatabaseQueryAsync will differ depending on what data access technology you use. Often, the method is called something like ExecuteScalarAsync.