A selective serialization ability of a multilayer object graph would be really convenient. This will provide the efficiency of lazyloading with the convenience of deep loading.
Of course, circular reference and other such issues need to be addressed.
One very good example is the way FlexJson parser in spring roo works. Here's a code snippet.
String[] fields = { "person.firstName", "person.LastName", "person.child.firstName", "person.child.lastName",
"person.child.grandchild.firstName", "person.child.grandchild.lastName"}
parser.serialize(person, fields);
Comments: Yes as DrZim as pointed out please use Dto's for this, and we've seen many teams leverage AutoMapper to help with mapping EF PoCo's to their Dto's.
Of course, circular reference and other such issues need to be addressed.
One very good example is the way FlexJson parser in spring roo works. Here's a code snippet.
String[] fields = { "person.firstName", "person.LastName", "person.child.firstName", "person.child.lastName",
"person.child.grandchild.firstName", "person.child.grandchild.lastName"}
parser.serialize(person, fields);
Comments: Yes as DrZim as pointed out please use Dto's for this, and we've seen many teams leverage AutoMapper to help with mapping EF PoCo's to their Dto's.