Reputation: 3131
I have two related entities.
Fruits.Apple Cars.Bmw
Those entities belongs to the same user and I want to use the userId as the partitionKey for both entities.
I am storing them in the same partition but when I use CreateQuery passing the partitionKey the query returns all entities with that partition and no only apples.
This is throwing an exception:
"The current value 'Fruits.Apple' type is not compatible with the expected 'Cars.Bmw' type."
Is there a whey to filter by type to avoid this kind of error?
Thank you,
Murilo
Upvotes: 0
Views: 77
Reputation: 1749
Adding a fixed length 'Type' indicator as a Row Key prefix, and filtering on the PartitionKey and the RowKey prefix as a range (>= prefix && < prefix+) will allow you to store multiple entities in one table and use the same partition key.
Upvotes: 2