Quantcast
Channel: User Pure.Krome - Stack Overflow
Viewing all articles
Browse latest Browse all 74

How to return a TypedResults.UnprocessableEntity in an ASP.NET Core Minimal API?

$
0
0

I'm trying to return an fffff from a Minimal API. When I set up the return type, I get a weird error:

the non-generic type 'IResults' cannot be used with type arguments.

enter image description here

public static async Task<Results<UnprocessableEntity<string>> HandleAsync(<snip>,    CancellationToken cancellationToken){    return TypedResults.UnprocessableEntity("Unable to make any payments using Ezidebit because there's no EziDebit Digital Id registered.");}

I can return other types here like <Task<Results<Ok, OK<string>, BadResult<string>>> etc.. Just this one TypedResult isn't working :(

Any suggestions, please?

Note: please ignore the screenshot that says I'm not returning it. Even when I change the code to return ssss; I still get the error.


Viewing all articles
Browse latest Browse all 74

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>