Hello,
I am trying to use Result.Try with an async lambda based on the non-async example in the README, somewhat like this:
Result<Guid> result = await Result.Try(async Task<Result<Guid>> () => {
await Task.Delay(100);
return Result.Ok(new Guid());
});
but Result.Try returns a Result<Result<Guid>> which is not what I expected.
Could this case be handled by adding an overload like this?
Task<Result<T>> Result.Try<T>(Func<Task<Result<T>>> action, ...)
Or is there a recommended way to handle this differently?
Thank you
Hello,
I am trying to use
Result.Trywith an async lambda based on the non-async example in the README, somewhat like this:but
Result.Tryreturns aResult<Result<Guid>>which is not what I expected.Could this case be handled by adding an overload like this?
Or is there a recommended way to handle this differently?
Thank you