We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BindAsync
The BindAsync overload for Task<Result<TSource>> and Result destination is missing.
Task<Result<TSource>>
Result
Minimal repro:
Create a new web API project and install Ardalis.Result and Ardalis.Result.AspNetCore.
Ardalis.Result
Ardalis.Result.AspNetCore
Program.cs:
using Ardalis.Result; using Ardalis.Result.AspNetCore; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.UseHttpsRedirection(); app.MapGet("/", async () => { var result = await SomeMethod(); result.ToMinimalApiResult(); }); app.Run(); return; async Task<Result> SomeMethod() { return await SomeAsyncIntResult() .BindAsync(i => SomeSyncResult()); } static Result SomeSyncResult() { return Result.Success(); } static async Task<Result<int>> SomeAsyncIntResult() { await Task.Delay(0); return Result<int>.Success(1); }
The code fails with: System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Proposed solution is in PR #224
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
BindAsync
overload forTask<Result<TSource>>
andResult
destination is missing.Minimal repro:
Create a new web API project and install
Ardalis.Result
andArdalis.Result.AspNetCore
.Program.cs:
The code fails with:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Proposed solution is in PR #224
The text was updated successfully, but these errors were encountered: