https://github.com/mongodb/mongo-aspnetcore-odata
Adds MongoDB support to Microsoft ASP.NET Core oData.
https://github.com/mongodb/mongo-aspnetcore-odata
asp-net csharp dotnet mongodb odata webapi
Last synced: 8 months ago
JSON representation
Adds MongoDB support to Microsoft ASP.NET Core oData.
- Host: GitHub
- URL: https://github.com/mongodb/mongo-aspnetcore-odata
- Owner: mongodb
- License: apache-2.0
- Created: 2023-06-27T15:45:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-10T21:18:29.000Z (over 1 year ago)
- Last Synced: 2025-01-29T09:43:41.769Z (over 1 year ago)
- Topics: asp-net, csharp, dotnet, mongodb, odata, webapi
- Language: C#
- Homepage: https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/odata/
- Size: 85 KB
- Stars: 18
- Watchers: 35
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MongoDB AspNetCore OData
[](https://www.nuget.org/packages/MongoDB.AspNetCore.OData/)
Integration library built on top of [Microsoft.AspNetCore.OData](https://www.nuget.org/packages/Microsoft.AspNetCore.OData/) package to enable OData endpoints for MongoDB.
## Package installation
```sh
dotnet add package MongoDB.AspNetCore.OData
```
## Getting started
Simply follow the [Getting Started with ASP.NET Core OData 8](https://learn.microsoft.com/en-us/odata/webapi-8/getting-started) guide, but use `MongoEnableQuery` attribute instead of `EnableQuery` whenever you are exposing `IMongoQueryable` as OData endpoint.
Please also use [MongoDB.AspNetCore.OData.Sample.WebApi](https://github.com/mongodb/mongo-aspnetcore-odata/tree/main/tests/MongoDB.AspNetCore.OData.Sample.WebApi) as a sample.
## Contribute
Should you encounter any issue with the package, please create [Jira ticket](https://jira.mongodb.org/projects/ODATA) so we can investigate and improve the library.