Skip to content

Commit

Permalink
fixes #187; add created option in ToMinimalApiResult (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalmow authored May 25, 2024
1 parent c5ccf3d commit dfc2cfc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ public static Microsoft.AspNetCore.Http.IResult ToMinimalApiResult(this Result r
internal static Microsoft.AspNetCore.Http.IResult ToMinimalApiResult(this IResult result) =>
result.Status switch
{
ResultStatus.Ok => typeof(Result).IsInstanceOfType(result)
? Results.Ok()
: Results.Ok(result.GetValue()),
ResultStatus.Ok => result is Result ? Results.Ok() : Results.Ok(result.GetValue()),
ResultStatus.Created => Results.Created("", result.GetValue()),
ResultStatus.NotFound => NotFoundEntity(result),
ResultStatus.Unauthorized => Results.Unauthorized(),
ResultStatus.Forbidden => Results.Forbid(),
Expand Down

0 comments on commit dfc2cfc

Please sign in to comment.