■
Source Code
The LinqWithSqlMetalGenedCode example can be found under the Chapter 24 subdirectory.
Building Entity Classes Using Visual Studio 2008
To wrap up our look at LINQ to SQL, create a new Console Application named LinqToSqlCrud and
reference the System.Data.Linq.dll assembly. This time, rather than running sqlmetal.exe to gen-
erate our entity classes, we will allow Visual Studio 2008 to do the grunt work. To do so, select
Project ➤ Add New Item, and add a new LINQ to SQL Classes item named AutoLotObjects (see
Figure 24-6).
Figure 24-6.
The LINQ to SQL Classes item performs the same duties as sqlmetal.exe.
Open the Server Explorer, and ensure you have an active connection to the AutoLot database
(if not, right-click the Data Connections icon and select Add Connection). At this point, select each
C H A P T E R 2 4
Do'stlaringiz bilan baham: |