-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update on Azure Cosmos DB Provider Limitations #2184
Comments
@balukantu What do you expect to gain from using EF instead of CosmosClient directly? |
Hi, Please find the below mentioned features/ functionality between CosmosClient and FCCore. CosmosClient EF Core |
It's derived from the entities, see docs
Not yet, dotnet/efcore#17309
You'd perform the filtering in the LINQ query. To specify a partition key explicitly see dotnet/efcore#17320 |
Thanks @AndriySvyryd I have gone through the documentation and identified the point Entity types with partition keys don't work correctly in some scenarios. So Can't we work efficiently with partition keys in EFCore? or As it is mentioned, can you list out the scenarios where it will not work? |
I installed 3.0 and 3.1.2 tried executing WithPartitionKey but looks like there is no method which accepts partition key. Can you please let us know in which version it is available? |
@balukantu dotnet/efcore#17320 is still open, meaning it hasn't been implemented. It's in the Backlog milestone meaning that we don't plan working on it any time soon. Usually you'd only need it when using a Resource Key for a particular partition key instead of a Master Key. If that's not the case you should be able to add a filter to the query, e.g. |
Hi I have a class like: While Create/Update an item in the cosmos Container we do like: dbContext.Employees.Add(employeeObject); and dbContext.Employees.Update(employeeObject); But how about to acheive Get and Delete operations: |
Making that work is tracked by dotnet/efcore#17310 |
@AndriySvyryd , The Find() method on EFCore accepts the only primary to fetch the record from CosmosDB and we are not passing the partition key value. So how the execution of Find() method? Will it check all partitions and returns the record? or how the Find() method works? Note: Except Find() method remaining methods accept the model as an input so the partition key can read from the model and the query is executed in the respective partition and returns the result. Please correct if my understanding is not correct. |
@balukantu It will work as expected if the partition key is part of the primary key |
@AndriySvyryd , Here, The model has a partition on other property which is not a primary key. Example: Below is the query to find the city by Id. The above LINQ query takes Id as a parameter and which is not a partition key. So, the question is, the query executed against all partitions? or how the execution will be? |
@balukantu The query will be executed against all partitions. |
We are currently using Cosmos Client and planning on using EF Core provider for CosmosDB in our application. We had the below few questions regarding this. Hope you can shed some light on these.
Thanks |
No. Currently there are many features that aren't implemented yet and it's unlikely that we'll ever expose all of CosmosClient functionality
Unlikely, it's built on top of CosmosClient. So by definition you won't be able to achieve better performance with EF Core than with CosmosClient.
Yes, if there's enough demand for them.
I would say that the biggest benefit of using the EF Core provider is to be able to write a new app much faster if you are already familiar with EF. If you have a working app that uses CosmosClient there would be little benefit from switching. |
Hi Team,
We are eager to integrate our application with Cosmos EF core provider but I am a little worried about the limitations of it.
My application is using CosmosClient and we are planning to integrate EF core.
There are some basic requirements mentioned below.
How would you recommend using the provider for production applications?
Thanks
Balu
The text was updated successfully, but these errors were encountered: