Tried to convert the Ardalis.Result return from my MediatR command to Microsoft.AspNetCore.Http.IResult using the ToMinimalApiResult() extension, and got a 500 from a thrown System.NotSupportedException when my Result value was Result.NoContent()
Assert.Fail(): Unhandled ResultStatus NoContent in MinimalApiResultExtensions.ToMinimalApiResult: System.NotSupportedException: Result NoContent conversion is not supported.
at Ardalis.Result.AspNetCore.ResultExtensions.ToMinimalApiResult(IResult result) in /Users/inghamc/git/ardalis/inghamc.Result/src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs:line 48
at Ardalis.Result.AspNetCore.ResultExtensions.ToMinimalApiResult(Result result) in /Users/inghamc/git/ardalis/inghamc.Result/src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs:line 32
I've added the missing case for NoContent and an xUnit test in a tests/Ardalis.Result.AspNetCore.UnitTests/MinimalApiResultExtensionsCoverage.cs that I'll include in a PR
Tried to convert the Ardalis.Result return from my MediatR command to Microsoft.AspNetCore.Http.IResult using the ToMinimalApiResult() extension, and got a 500 from a thrown System.NotSupportedException when my Result value was Result.NoContent()
I've added the missing case for
NoContent
and an xUnit test in atests/Ardalis.Result.AspNetCore.UnitTests/MinimalApiResultExtensionsCoverage.cs
that I'll include in a PR