-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cosmos DB LINQ provider with Odata sans EF #155
Comments
The other library was started because of questions about using this one with OData. I would use the code here and here as a guide. I'm pretty sure none of that is EF specific. It's creating the selections and expansions from |
@BlaiseD Now are you talking about a third project in this repo? So, something like That would be nice but there are differences between how queries are executed asynchronously between EF and the Cosmos LINQ provider (which may require exposing CosmosDB specific stuff in the public facing API). Also, some Odata options may not make sense with a NoSQL DB (expansions for example as there are no joins except for inner joins which could be translated to |
Yes - that is what I meant - a similar project in the repo. I don't know the details. If you're getting data from the query and translating the data into LINQ expressions then I'd assume it's possible to match the given provider e.g. the Get method uses includes as opposed to expansions. Or maybe what you already have is the best option - depends on what you find. |
@BlaiseD I'm going to make a feature request on the other repo. I'll start working on this (most of it is already done but I want to utilize a lot of the helpers already defined in both this repo and the other). |
Hi Blaise,
So, for the last couple of weeks I've been trying to use the
Cosmos DB
LINQ provider with Odata.I'm not using EF as it's generating incorrect SQL.
Anyway, some issues I've run into for example is that
$select
does not work (full stop).I had to completely replace the
MethodCallExpression
representing theSelect
method call and generate a new runtime type in order to get that working.Next, I created an
Expression
tree visitor which replaces allExpression<TSource>
toExpression<TDest>
expressions usingAutoMapper
for type mappings.All works well, but I know that you have this repo as well this repo and I'm wondering if I'm just reinventing the wheel here.
Questions
For example:
Granted, in the above example, I don't think that would work unless you also had a destination
IQueryable
to work with.What I'm thinking of is to first apply the Odata query to the
CosmosEnumerable
, pass theExpression
to themapper.MapExpression
and then use mySelectReplacer
to replace the invalidSelect
MethodCallExpression
with a valid one.Or maybe I can use this library within my
Expression
visitor to map anyExpression<TSource>
toExpression<TDest
.I'm just not 100% sure on how this library is supposed to be used.
The text was updated successfully, but these errors were encountered: