Elfocrash / Cosmonaut

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

Problems with partitionkey and FindAsync in a non-partitioned collection #28

Closed gdahlin closed 5 years ago

gdahlin commented 5 years ago

I use a shared collection (that is non-partitioned) for my implementation, and have added the SharedCosmosCollection attribute together with the SharedCollectionName property.

Persisting entities and query (all) works fine, but the ICosmosStore.FindAsync method generates the Exception:

Microsoft.Azure.Documents.DocumentClientException: Partition key provided either doesn't correspond to definition in the collection or doesn't match partition key field values specified in the document.

Any help would be highly appreciated.

Elfocrash commented 5 years ago

Hello @gdahlin.

You are absolutely right. There was some code from when shared collections needed to have a partition key that's left there.

It is a simple fix so I will fix it and notify you when 2.3.2 is released later today.

Thanks!

gdahlin commented 5 years ago

Great, very nice, thank you!

Elfocrash commented 5 years ago

Fixed in 2.3.2. You can update https://www.nuget.org/packages/Cosmonaut/2.3.2

PS: Give it a second to index the package

gdahlin commented 5 years ago

Works fine! Thanks for fast update!