Vendor asks to expose a rest api as odata, trying to understand how it works in odata world, my assumption is the data model present themselves as entities, which then enables filter by query string, but how would a odata query work on a relational data model, e.g. on customer orders, I cannot simply join the entire customer and order table then return the entire dataset! (or maybe I could just return them as paged data?) could someone point out some best practice for designing odata webapis? much appreciated!! thanks!!!
Newbie on webapi odata
168 Views Asked by TOMMY WANG At
1
There are 1 best solutions below
Related Questions in ASP.NET-WEB-API
- Log to Dynatrace using Serilog and web.config .NET Framework API
- How to create a REST API with .NET Framework?
- ASP.NET Core Background task with service container
- App gateway closing connection after 100 requests
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- The 'GetUriByAction' method in the LinkGenerator class in Asp.Net Core is not defined in the Repository layer of the project
- Entity Tracking Conflict when Authenticating Users in ASP.NET Core API
- Class validation on response body in .NET WebApi
- My ASP.NET server does not work and I am wondering what's missing, when I open Swagger, I get error 500
- How to split Serilog log file into multiple files?
- Response payload is not odata payload
- How can I upload picture
- Web Forms aspx - PostAsync Web API
- do you know any free reporting services like devexpress or boldreports?
- WebAPI don't deserialize JSON but same payload works in Swagger
Related Questions in ODATA
- How to serialize the entire Microsoft.AspNetCore.OData.Results.PageResult<T> object with Newtonsoft.Json in .NET 6?
- possible to index singleValueExtendedProperties in MsGraph?
- D365 F&O - Cannot post addresses with OData
- How to get access token correctly from SAP Successfactors api?
- Odata filter DateTime casting string to DateTime and Filtering
- Response payload is not odata payload
- how to remove namespace from query string to filter an enum field with OData V4 in .NET
- Odata Put endpoint doesn't work as expected on ASP.NET Core MVC web service
- Odata filter query Unrecognized 'Edm.String' literal 'datetime'
- OData unit testing in .NET Core 6.0
- OData rest API with MS Project Online (SharePoint) "User not found in active directory or Project db
- How to upload data in power apps table using python
- ASP.NET Core OData creating generic pass through controller for underlying APIs
- MS Graph /drives/{drive-id}/items/{item-id}/children filter not folders
- Connecting to URL with Token within SSIS
Related Questions in ASP.NET-WEB-API-ODATA
- OData: how to implement @odata.bind to insert foreign key value to a table from .NET 6 using C#
- Running a long running background task from OData/Web API request running on Azure App Service (.Net Framework)
- How to cast SelectExpandQueryOption to IQueryable<T> when using OData in WebAPI?
- WEB API OdataController POST call returns 406 Not Acceptable
- ODataRoutePrefix not working for 3rd level
- Delete record with composite primary key in OData
- Web API OData - ODataMediaTypeFormatter MediaTypeResolver no longer exists
- How to test the patch odata webapi method with Delta<Tentity> which has some collection properties
- Coding my WebApiConfig.cs for a Database First oData Endpoint Service
- How to convert GZipStream to HttpContent?
- Asp.net Webapi Empty string condition check in Get Action Method
- Add list of entity as parameter
- Using Odata enabled ASP.NET Web-API to call a Stored Procedure
- How to change the service root in webapi odata v3?
- Newbie on webapi odata
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I guess, you are using Entity Framework as a Model for OData. so
would do the trick for a multiple row fetch.
Basically, $expand (JOIN on other tables) and $filter and $select are automagically applied using your whole EF model.
But if you fear that private data or secure data would be exposed, you have to apply prefiltering. return Ok(myDb.Customers.Where(w => w.CustomerId == myCustomerId))
Odata has built in settings to avoid it to return say, 10.000 rows. You are quite free configuring that all. But expect some learning curve because after all, you might need extra modelling and navigation property optimization.
In addition, you have by default on an OData controller, GET/POST/PUT/PATCH/DELETE methods, but you also might want custom functions/actions that you have to define.
On Github, Microsoft has quite some samples.
https://github.com/OData/ODataSamples/tree/master/WebApi/v4