You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If anyone is interested, I can write up a whole thing, but I narrowed it down.
In EF Core for Cosmos, OwnsMany properties are automatically embedded in the document (item) as an array.
In my case, I had an Invitation aggregate that had a list of InvitationEvents. Each InvitationEvent contained a DateTimeOffset and an InvitationEventType, which was a SmartEnum. Defined as below:
What was happening was that each event was being written to the default Cosmos container with a default Guid value. That is, the Invitation ended up in the proper container and the InvitationEvents ended up in the default container. Wild.
If I changed that SmartEnum to a simple enum, my document contained a collection of InvitationEvents as expected, with no configuration.
If you're seeing something nutty with your child objects, I hope this helps.
p.s. Yes, I'm using modelBuilder.ConfigureSmartEnum();
p.p.s. No, I did not try this with EF Core on a SQL Provider.
The text was updated successfully, but these errors were encountered:
If anyone is interested, I can write up a whole thing, but I narrowed it down.
In EF Core for Cosmos, OwnsMany properties are automatically embedded in the document (item) as an array.
In my case, I had an
Invitation
aggregate that had a list ofInvitationEvents
. EachInvitationEvent
contained a DateTimeOffset and an InvitationEventType, which was a SmartEnum. Defined as below:What was happening was that each event was being written to the default Cosmos container with a default Guid value. That is, the
Invitation
ended up in the proper container and theInvitationEvents
ended up in the default container. Wild.If I changed that SmartEnum to a simple enum, my document contained a collection of InvitationEvents as expected, with no configuration.
If you're seeing something nutty with your child objects, I hope this helps.
p.s. Yes, I'm using
modelBuilder.ConfigureSmartEnum();
p.p.s. No, I did not try this with EF Core on a SQL Provider.
The text was updated successfully, but these errors were encountered: