here are a couple of options:

  1. look at using another context to implement your materializationrepositories and have it backed by an in memory database such as effort, if that's still working nowadays.
  2. re-implement the 'include' functionality yourself on the materialization. the expression can be broken down to find the type of the navigation property. using naming conventions you can work out what foreign key property you need to interrogate to get the correct identifier. to find the target repository you could use reflection over the materialization looking for the public property of type ienumerable of the type of the navigation property. as long as you knew the name of the primary key of the target entity (by convention, say) you could then use the foreign key value to find it.

if you have a small number of entity types you'd probably be better off having some kind of switch statement and do some of it manually rather than via reflection.

apologies that this isn't a fully worked through implementation, but i hope it leads in the right direction.

Related Query

More Query from same tag