Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm use the Repository pattern along with EF at work. I'm wondering if there is a way for me to make an addon or somehow tap into the EF code generation of the table classes when the model is saved. So that I can automatically generate the repository stub as well.

I'd also like to check if it already exists and if so not to regenerate (as the stub might have custom code for that EF type).

share|improve this question

closed as unclear what you're asking by MichaelT, Snowman, durron597, GlenH7, MetaFight Jul 24 at 11:48

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

The code generation is done by T4 templates. You can create your own custom templates to generate the repository classes. Some links to explain T4 templates.

share|improve this answer
Yes, this is the answer. Once you master T4 templates you can solve all those problems, and wonder how you ever managed without them. –  david.pfx Apr 12 '14 at 10:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.