i have one-to-many relationship 'child' entity can soft deleted. must load parent instance containing child instances in 2 different scenarios:
- edit scenario: load children including have been "deleted".
- view scenario: load children have not been "deleted".
i can think of 2 different ways implement in domain model, , question is: way(s) is(are) supported ef code-first , what's relative complexity of each?
- two mapped collection properties:
ilist<child> children
,ilist<child> deletedchildren
. - one mapped collection property
ilist<child> children
,isactive
property onchild
marking children have not been deleted. scenario 2 need load parent suchchildren
filtered contain instances haven't been deleted.
i mention, in case matters, situation hierarchical (but 2 levels deep). is, children parents "soft delete" situation.
Comments
Post a Comment