1

I am working with a large Entity Framework 4.0 edmx, and need to automate the construction of the edmx. However, I needto maintain the ability to use customized T4 templates.

In our edmx, we have code generation set to None, so we can use multiple T4 templates against the edmx. When I build using EdmGen, the code is generated using the default template.

I experimented with EdmGen2, and it can be customized to allow for our T4 templates, but it wasn't able to correctly pluralize collection names, even with the .edmx property explicitly set.

Any help to get EdmGen or EdmGen2 to work in this situation would be much appreciated.

johnsondl1
  • 83
  • 1
  • 5

1 Answers1

0

I was able to make EdmGen2 handle pluralization correctly.

The CSDL generator does not, in the current version of EdmGen2, have a PluralizationService configured. With a one line modification to force it to use the default pluralization service, it builds the correctly pluralized csdl.

johnsondl1
  • 83
  • 1
  • 5
  • Got that one-liner handy? I'm reasonably sure the left half is "emsg.PluralizationService = ", but don't know my way around the api yet. – Levi Dec 22 '10 at 01:23
  • Okay, this is untested, but I'm guessing it's this: PluralizationService.CreateService( new CultureInfo("en-US")) – Levi Dec 22 '10 at 01:25
  • You got it: emsg.PluralizationService =PluralizationService.CreateService(CultureInfo.CurrentCulture); My only caveat to that is that this doesn't seem to be as smart as the default pluralization service that EF uses. It mishandles some odd plurals like "Status", but the pluralizer can be configured to include special cases for those. – johnsondl1 Dec 22 '10 at 22:16