Entity Framework 4 relationship management in POCO Templates - More lazy than FixupCollection?
Posted
by Joe Wood
on Stack Overflow
See other posts from Stack Overflow
or by Joe Wood
Published on 2010-03-28T18:21:14Z
Indexed on
2010/03/28
18:23 UTC
Read the original article
Hit count: 591
I've been taking a look at EF4 POCO templates in beta 2.
The FixupCollection looks fine for maintaining the model correctness after updating the relationship collection property (i.e. product.Orders it would set the order.Product reference ).
But what about support for handling the scenario when some of those Order objects are removed from the context? The use-case of maintaining cascading deletes in the in-memory model. The old Typed DataSet model used to do this by performing the query through the container to derive the relationship results.
Like the DataSet, this would require a reference to the ObjectContext inside the entity class so that it could query the top-level Order collection. Better support for Separation of Concerns in the ObjectContext would be required. It looks like EF is not suited to this use-case that DataSets did out of the box.... am I right?
© Stack Overflow or respective owner