sparc-coop / blossom

Blossom is an opinionated framework-of-a-framework for .NET 7.0 Web, Mobile, and Desktop development using a single shared codebase (C# and Blazor).
MIT License
17 stars 2 forks source link

Sparc.Database.Cosmos UpdateAsync() is not deleting any removed/replaced owned entities #22

Open josephatkuvio opened 2 years ago

josephatkuvio commented 2 years ago
entity.OwnedEntities.Remove(x);
await Repository.UpdateAsync(entity);

Owned entity is not removed

josephatkuvio commented 2 years ago

This probably has something to do with the .Add and .Update calls in UpdateAsync() which are resetting the entity state of the owned entity back to Added/Modified.

Temporarily fixing by exposing the context so we can save changes directly after removing.