> I would like to understand if there is a better way to handle the
> relation between the main entitiy and navigation properties when a
> SaveChanges() fails.

It's generally expected that every change in DbContext (and hence in
UOW) will be saved. The user will eventually fix all validation
violations. Hence the skipping is kind of non-standard scenario.
Detaching the graph is then correct solution. Sadly you have to detach
the whole graph manually
(https://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.detach(v=vs.110).aspx).
Given the DbContext is the UOW these no way to disconnect these - have
one DbContext with multiple UOWs (where you'd discard that UOW with
violations and continue saving). Or course poor man's solution would be
to create bunch of DbContexts, but I'm afraid that would hurt
performance and add complexity on the other side with attaching.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to