You can add a LINQ to SQL data model to an ASP.NET, Class
Library or Windows client project by using the "Add New
Item" option within Visual Studio and selecting the "LINQ to
SQL" item within it:
Figure 2
Selecting the "LINQ to SQL" item will launch the
LINQ to SQL designer, and allow you to model classes that represent a relational
database. It will also create a
strongly-typed "DataContext" class that will have properties
that represent each Table we modeled within the database, as well as methods
for each Stored Procedure we modeled. As I described in Part 1 of this blog post series, the DataContext class
is the main conduit by which we'll query entities from the database as well as
apply changes back to it.
Below is a screen-shot of an empty LINQ to
SQL ORM designer surface, and is what you'll see immediately after creating a
new LINQ to SQL data model:
Figure 3