Produce Project Temeplate dynamically form a dbml model? RRS feed

  • Question

  • Hi,

    I'm working on a component base model project, It means that when a developer wants to add something to the main project, He should make a his solution as component which consist of some project.

    All the time that some one wants to add a new component, He should write some repeatedly code,

    So I'm going to make a project template(or I don't know, may be something like code generator) to generate this repeatedly code automatically.

    It's good to know that our component should generate base on an dbml model(linq to sql),

    So my project template(or code generator) should get dbml model first to produce its template dynamically

    I've recently  met T4, I think I could be a good thing form me to generate my code.

    Please let me know your idea about that

    Wednesday, May 11, 2011 5:45 AM


  • One possible solution would be to create a project template with a wizard that lets the user DBML model they want to base their project on as the first step. Afterwards I believe you should be able to generate the files in project in any way you want (including T4). This would be a similar behaviour to other templates that are based on data sources such as databases etc.

    There is a walkthrough at http://msdn.microsoft.com/en-us/library/7k3w6w59(v=VS.100).aspx that shows how to create a template with a wizard.


    Bertan Aygun


    Friday, May 13, 2011 2:42 PM