How to access Entiydatamodel in T4 template

60 views Asked by At

I want to access my entity data model in T4 templates. I want to generate some code from database in t4 template.

    ex: using(var context=new Mymodel())
    {
    //db operations
    }

Please help me
thank you.... 
1

There are 1 answers

0
Pratik Mehta On BEST ANSWER

You can pass the parameter to your template.

https://msdn.microsoft.com/en-us/library/gg586944(v=vs.120).aspx