Marco S.
Marco S.

Reputation: 137

Programmatically import stored procedures in T4 in EF 5

I have a T4 template that generates the edmx model of my DB; I have to use this T4 template because i have to define my own localized pluralization dictionary to manage plurals/singulars.

The bad thing is that i have to manually import my stored procedures every time, after i launched my T4 template, via the 'import function' menu.

Is there a way to import the stored procedures programmatically?

Is the code of the "import function" wizard available and open source?

Mostly i'd like to see how they implemented the 'obtain column informations' to generate the result class.

Upvotes: 1

Views: 465

Answers (1)

podiluska
podiluska

Reputation: 51494

The EDMX file is just XML. You can programmatically open and edit that XML file as you would any other.

I would imagine that "Obtain column information" works by using ADO to query the parameters, (see http://support.microsoft.com/kb/174223 ), populating them with dummy values, and querying the result - I think that would work, but perhaps SQL profiler would reveal more.

Upvotes: 1

Related Questions