With Danny advices, I improve my custom code generator to do this in only one generation. public class SampleEdmxCodeGenerator : BaseCodeGeneratorWithSite { private EntityContainer _objectContext; private Dictionary < string , string > _entitySetNames;...