Is there a way to get the result of a Task.Run function like this
private Task<bool> UpdteSth(double bla)
=> Task.Run(() =>
{
try
{
UpdateOneAsync(doStuff);
}
catch (Exception exception)
{
sentryClient.CaptureException(exception);
return false;
}
return true;
});
from a caller method like this
public async Task<Entity> Get()
{
UpdateSth(double bla);
}
without having to await UpdateSth so Get can freely do whatever it needs without having to wait to UpdateSth result? I still need to get the result of UpdateSth() to do some logging business but other than that Get should not wait for UpdateSth to be done to continue its job. Clearly, await and Task.FromResult() still make my Get() to wait for the result or UpdateSth to be done so I cannot used those.