Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
341 stars 44 forks source link

Using Cosmonaut with OData? #70

Closed Mortana89 closed 5 years ago

Mortana89 commented 5 years ago

Hi,

Currently we're using our own fork of EF Core 2.2 preview 3, with dozens of fixes, as our ORM that communcates with Cosmos DB. We always have an API service that handles individual gets, puts, posts etc. And then we have an OData service that handles an OData query, purely for reading, and outputs a list that is displayed in a listpage to the user. Since EF Core does not support continuation tokens at all, and we're actually at the point of thinking of moving away from EF Core, due to the (at least for now) lack of more 'complex' cosmos queries, I'm investigating the effort of moving the whole infrastructure layer to Cosmonaut. One of the things I'm investigating here is the possiblity to use OData with Cosmonaut.

Any experiences with this?

Elfocrash commented 5 years ago

Hello @Mortana89.

I have never used OData in general so I can't really answer this one. I could give you a hand if you point me to the right direction but I have no experience with this specific feature.

Mortana89 commented 5 years ago

I've attempted to put OData in front of Cosmonaut, but many queries cannot be evaluated, I don't think that's possible to fix. Basically OData is a layer that translates a URL into an IQueryable. But the latter is not completely compatible with Cosmos DB in general. This can be closed for now, we'll probably set up a seperate DW and provide an OData api on that one.

Elfocrash commented 5 years ago

It makes sense as the Cosmos DB SDK doesn't support most of the LINQ to SQL methods. Cosmos DB is using it's own internal implementation of something called the IDocumentQueryable which is really limited at the moment.