AspNetCoreOData | NET Core OData : A server library built upon ODataLib
kandi X-RAY | AspNetCoreOData Summary
kandi X-RAY | AspNetCoreOData Summary
Be noted: Switch to use "main" as default branch. 1/6/2022. This is the official ASP.NET Core OData repository. ASP.NET Core OData is a server side library built upon ODataLib and ASP.NET Core.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AspNetCoreOData
AspNetCoreOData Key Features
AspNetCoreOData Examples and Code Snippets
Community Discussions
Trending Discussions on AspNetCoreOData
QUESTION
I have a simple .NET6 OData API with the default configuration with Batch enabled. The API is configured with IdentityServer from the default VS template.
Program.cs
ANSWER
Answered 2022-Mar-04 at 04:31I ended up adding a middleware that repopulates the IHttpContextAccessor
manually.
QUESTION
Can someone please explain why my EnableQueryAttribute filter is not firing when the client query does not include the Count=True in their query? My entire dataset is returned.
...ANSWER
Answered 2022-Feb-06 at 14:38Have you tried deliberately setting the property in the constructor? This has the added benefit of still allowing you to override the default page size at each endpoint.
QUESTION
After updating to Microsoft.AspNetCore.OData
from 7.5.8
to 8.0.0-rc2
the ~/odata/$metadata
url is not working anymore, it just returns 404 - Not found.
Before I file a bug, am I doing the configuration wrong?
I followed this blog and the somewhat updated documentation in the Git repo.
Here is my original Startup.cs
for 7.5.8
:
ANSWER
Answered 2021-May-11 at 22:31I found the solution:
I had to change the sdk in the csproj file from Microsoft.NET.Sdk.Worker
to Microsoft.NET.Sdk.Web
.
(Basically the project is a .NET 5 SDK-style Windows Service / BackgroundWorker with an Asp.Net Core API included.)
It seems this was not an issue with earlier versions before 8.*
QUESTION
We have created a .NET Core API which uses Odata to filter, select, and expand the data. The data is stored in a Microsoft SQL Server database and retrieved through EntityFramework Core (code first). We use Linq projection so the Odata filter is applied directly to the query, but this gives an error in the following situation:
When retrieving a list of results, e.g. authors expanded with books, everything works fine. It gives an error when filtering inside the expanded books e.g.: https://localhost:44316/odata/authors?$expand=Books($filter=Id eq 1)
...ANSWER
Answered 2021-Feb-18 at 20:42Well, it is common mistake when working with Expresion Tree. You cannot use ToDto
in that way. LINQ translator has to see Expression Tree but not compiled lambda.
There are two libraries, that I know, and which can help you to achieve this result:
https://github.com/hazzik/DelegateDecompiler
https://github.com/axelheer/nein-linq
Then you have to rewrite your helper methods (using DelegateDecompiler):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AspNetCoreOData
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page