Skip to content
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

Index attribute on BaseEntityTableData prevents CosmosEntityTableData with CosmosDB EF Provider #173

Open
richard-einfinity opened this issue Dec 28, 2024 · 2 comments
Labels
Bug Something isn't working Client Improvements or additions to the client code
Milestone

Comments

@richard-einfinity
Copy link
Contributor

Describe the bug

Index attribute on BaseEntityTableData prevents CosmosEntityTableData with CosmosDB EF Provider. Context throws System.InvalidOperationException. The entity type 'ModelName' has an index defined over properties 'UpdatedAt,Deleted'. The Azure Cosmos DB provider for EF Core currently does not support index definitions.

To Reproduce

Steps to reproduce the behavior:

Define Models based on CosmosEntityTableData
Add Models to Context and perform entity configuration.
Call await dbContext.Database.EnsureCreatedAsync();

Expected behavior

Database and containers to be created in CosmosDB

What platforms?

Note: Any bug or feature request that is opened for an unsupported environment will be automatically closed.

  • Server:
    • Version of dotnet being used to compile? net8
    • Library versions? CommunityToolkit.Datasync.Server.EntityFrameworkCore 8.0.4.
    • What database are you using? CosmosDB
    • Where are you running the server? Azure

Additional context

Worked around by creating a new CosmosEntityTableData base model inheriting from ITableData directly.

@richard-einfinity richard-einfinity added Bug Something isn't working Requires Triage This issue has not been checked by the project team. labels Dec 28, 2024
@adrianhall adrianhall added Client Improvements or additions to the client code and removed Requires Triage This issue has not been checked by the project team. labels Jan 1, 2025
@adrianhall adrianhall added this to the 8.0.5 milestone Jan 1, 2025
@adrianhall
Copy link
Collaborator

Do you have a minimal repro that I can look at?

@richard-einfinity
Copy link
Contributor Author

I'll put together a repo based on the Todo Sample. There's a few other issues that have come up which will be a problem for 9.0. I'll document them separately. But just as a quick note, In the TableController.Query.cs there's a comment mentioning calling ToListAsync but the call is actually ToList in the client evaluation function. Do these methods need to be made Async?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Client Improvements or additions to the client code
Projects
None yet
Development

No branches or pull requests

2 participants