views:

19

answers:

0

How do I include child entities from a DomainService, without the chance of my code being overwritten when I generate a new DomainDervice? I am trying to include sub entities with my query.

For instance, I have a ParentTable and a ChildTable. I can retrieve the ChildTable entities as follows:

  1. Modify the DomainService metadata file to decorate the ChildTable with the Include attribute
  2. Modify the DomainService file's GetParentTable query to 'objectcontext.ParentTable.Include("ChildTable")'

That works fine, but is not ideal because if I add a field to the database schema, then I will have to update my Entity Model and the Domain Service, thereby wiping out my changes mentioned above.

Is there a way to Include child/sub entities without the code being overwritten, possibly outside of the generated domainservice.metadata and domainservice files?

Thanks