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

Missing Note: EF Core Cosmos provider does not support collections of primitive types #2895

Closed
seangwright opened this issue Nov 21, 2020 · 1 comment · Fixed by #2953
Closed

Comments

@seangwright
Copy link

Currently there is a feature missing from the EF Core Cosmos provider - it cannot handle collections of primitive types on entities.

This is something that Cosmos (and all other document storage systems) support natively. It is the EF Core provider which prevents a developer from using this normal functionality.

I just spent an hour searching the (very very limited) EF Core Cosmos provider docs, blogs, the EF Core repo, ect... trying to figure out what was causing this exception:

'The property [...] could not be mapped because it is of type 'ICollection', which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.'

Whether or not the provider supports this functionality isn't what I'm concerned about (though, this seems like a big feature gap), but it should be mentioned somewhere in the EF Core Cosmos provider docs that this is a current limitation, along with the exception message to help developers figure out why this doesn't work.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@unt1tled
Copy link

unt1tled commented Nov 21, 2020

Just ran into this issue as well while following MS's own recommendations on modeling and partitioning. Having to create separate complex objects just for this bloats our scheme here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants