Replies: 1 comment
-
Hello @dwoldo, the The first approach is probably the easiest and most standard way. You could map the endpoint to your schema as a bound function. To learn more about creating endpoints for bound functions, check out the docs: https://learn.microsoft.com/en-us/odata/webapi-8/fundamentals/actions-functions So in this case you could register var builder = new ODataConventionModelBuilder();
var endpoint = builder.EntitySet<Endpoint>("endpoints");
endpoint.EntityType.HasKey(x => x.Id);
+ builder.EntityType<Endpoint>().Collection
+ .Function("withStaticFilters")
+ .ReturnsCollectionFromEntitySet<Endpoint>("endpoints"); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all! 👋
I'm trying to add a new GET endpoint that accepts query parameters and returns an OData-compliant response.
✅ Expected Response
❌ Actual Response
[{ ... }]
🧾 Controller Setup
⚙️ Program/Startup Configuration
❓ Question
How can I modify the
withStaticFilters
endpoint so it returns a proper OData response (with@odata.context
andvalue
)—just like the default GET route?Is there a limitation with custom routes like
v1/endpoints/withStaticFilters
, or do I need to configure something extra to make it OData-compliant?Any guidance is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions