Replies
Bingo!! It works!! Pablo if we should ever meet I owe you an obscene amount of alcohol!! In the meantime, please accept my sincere thanks at spending the time to walk me through this with my, still limited, knowledge of C#. Having this problem, and then your advice has actually taught me a lot. Many thanks.
Anthony
Thanks for continuing to help me. Getting there now. Here is the code and I am now returning a PersonModel using Produces statement.

This still works with Swagger

And in AppBuilder almost but…


Then I can’t bind to the grid as now options sow against the source. “This resource contains a single object” indicates my Produces isn’t right I guess?
Anthony
PS. It’s early hours of the morning here so I’ll pick this up tomorrow. Thanks again.
Hi thanks for the reply Pablo. I will just point out that my current code using Results.OK does work fine with Swagger,and with other projects that call the REST endpoints. I get back proper return codes 200, 404 etc. and Json data and the schema shows in Swagger too.
The documentation link you referred me to states. "Minimal endpoints support the following types of return values:"
string– This includesTask<string>andValueTask<string>.T(Any other type) – This includesTask<T>andValueTask<T>.IResultbased – This includesTask<IResult>andValueTask<IResult>.
So I would have expected AppBuilder should support Task<IResult> as I think that is where the issue is. Even if I change the return Results.OK(…) to return TypedResults.OK(…) app builder stays greyed out I suspect because the PersonGetAll() function returns a Task<IResult>.
My C# knowledge is far from complete as mentioned above. Any ideas how I can refactor those calls as all my many endpoints work in this manner. Thanks.
Hello sorry to jump in here but I have the same issue. I think I understand what you are saying Hristo, (I’m an old programmer learning new tricks here!!) and I noticed that even in Jason Beres video https://www.youtube.com/watch?v=d9X0Q5iY8OE&t=2039s here at 34:07 you can see that several of the endpoints are greyed out – those greyed related to the changes he did at 25:13 when instead of returning a simple list (as I understand it) he is now returning a Http Results. Have I undersood that correctly?
If so, then my code is as below. Where my endpoint calls a function Data.PersonGetAll which itself calls a stored procedure via Dapper. But I think the issue is returning an IResult?
// this line part of Configure endpoint function
![]()
// then below

How can I change that to return something that AppBuilder can work with?
Thanks, And I appreciate this may be beyond the bounds of this support forum.
Thanks, Anthony