Dan Lugg
Dan Lugg

Reputation: 20592

Generated, namespaced POCO classes

(I feel like I'm missing something important here.)

I'm creating a WCF Data Service (5.0) using the "database first" approach for the entities.

I've created tables with "namespaced" names, using the . (dot) such as [Entertainment.Event] and [Promotions.Event].

The EF 4.x POCO generator template of course knocks these out, via the call to CSharpCodeProvider.CreateEscapedIdentifier().

I'd like very much to generate (and regenerate, and appropriately map) namespaced POCOs; specifically, preserving the implied namespaces of the tables.

What am I looking at as far as accomplishing this? I'm guessing it will involve awhile's worth of swimming through T4 templates.

Ultimately, is this doable?

Upvotes: 1

Views: 133

Answers (1)

Serge Belov
Serge Belov

Reputation: 5793

I'd suggest to create one context per your DB schema, placing each one into whatever namespace you like.

Upvotes: 2

Related Questions