The result should look like this: Save and close the the O/R desinger.
In solution explorer you should see the file, expanding this shows two other files, layout and University. Data Context, and your model classes which were generated from the dbml file.
A newer version of this LINQ to SQL template is available.
Opinion may be divided on the usefulness of #regions in your own code but for code generation of large files I found it invaluable.
There are regions for the logical parts of the data context and within each entity such as construction, column mapping, associations and serialization.
Well he had added methods but had done it by modifying the generated source code which were overwritten if he wanted to update a table to pick up some new fields.
One of the big advantages of using LINQ to SQL is the speed of development it allows.
Gayani provides the complete source code for a sample Data Access Layer for LINQ to SQL, using the Northwind Database, and explains how it all works and how to get good performance.
She shows how easy it is to use stored procedure and views as well as queries to provide a robust run-time infrastructure for managing relational data as objects.
You don't need this, but if you want really get the most out of T4, first, head over to Clarius Consulting and get their "T4 Editor Community Edition." That'll get you some basic coloring.
They have a pay version that gets you more if you want.
How do you do the same with Linq to SQL without hacking the generated code.