I am using Linq-to-SQL for my projects but i heard about the T4 Template Code generator? Whether T4 Template is better then Linq-To-SQL Data Context?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are mixing two things. LINQ to SQL is an O/RM tool, just like NHibernate, Entity Framework, LLBLGen, and others. T4 is a code generator tool. They’re not mutually exclusive.
There are T4 templates for LINQ to SQL that allow you to generate your LINQ to SQL entities and
DataContextin a different way than the LINQ to SQL code generator would do. Using LINQ to SQL without aDataContexthowever, is impossible. When you’re not using theDataContext, you’re not using LINQ to SQL.Using T4 templates to generate entities and
DataContexthowever, can be beneficial. You will have look at the benefits of a particular template and decide whether this is useful to you, or not. For instance the L2ST4 template project on codeplex closely resembles the code that L2S would generate itself, but allows you to alter the template for your own needs.