ASP.NET API Controller not returning values shown in debugger
I am attempting to return a list of chores when the user queries an endpoint
/Chores?page=1&pageSize=10
. This endpoint takes the user's claims and pulls a list of that users chores, paginating them as requested. This seems to work fine from the debugger, with the Controller showing 10 chores (a full page) and a total chore count of 26 (see image 1) being returned as a JsonResult. However, the response I receive when querying this endpoint via Swagger UI is an empty object {}
(image 2), even though the response is 200 and I know the controller function returned valid data.
What could be causing my controller to return a blank value, even when the debugger indicates it is returning valid data?2 Replies
what does the DTO look like. Do you have fields in there instead of properties like they should be?
Well that did it. I had this working previously without it being a property and I am not sure exactly what changes I made in that time caused this (I am doing a major port to Blazor from Razor Pages). Oh well. Thank you for your help.