Code-first support for EntityGraph

Nov 1, 2011 at 8:38 PM

As far as I can tell, there's no built-in support for creating an EntityGraph from code-first entities.  Is this something you will be adding?  For example, instead of looking at AssocationAttribute in order to build the graph, you could look at InversePropertyAttribute or ForeignKeyAttribute.  Though both of these wouldn't handle all workflows.  You'd probably have to create and EntityGraph by handling an instance of System.Data.Entity.DbContext.

Nov 1, 2011 at 10:00 PM


As I described here, entity graph shapes are defined in a rather generic way using lambda expressions. Therefore, EntityGraph can also be used for code-first entities.

The use of AssociationAttribute for defining graphs is obsolete and no longer supported by recent versions of EntityGraph.

If possible, use Nuget to obtain the most recent version of EntityGraph (or use subversion to check-out the source code).

I hope this answers your questions.