Hi guys,
Let me try to explain my scenario.
I have two ViewModels working with different unit of works and entity managers.
In the first one, I have a list of entity loaded using this method:
private async Task<BindableCollection<Something>> LoadData()
{
var repository = UnitOfWork.GetRepository<Something>();
var entityData = await repository.AllInDataSourceAsync(fetchOptions: f => f.Include(i => i.SomethingProperties));
return new BindableCollection<Something>(entityData);
}
In this first ViewModel, I have a button that calls the second ViewModel (childWindow). In the second ViewModel I'm able to create, edit or delete data from entity Something and SomethingProperties.
So, when deactivate the childWindow I call LoadData() again to refresh my list. As I use AllInDataSourceAsync the update happens perfectly in the entity Something, but the navigation (SomethingProperties) shows objects that I have deleted (???) with them that I have just created (ok).
PS: Before close the childWindow I have saved changes in the second entity manager. If I check the database, it is everything ok.
What is my mistake?