table and drag it onto the LINQ to SQL designer surface. Once you are done,
your screen should
resemble Figure 24-7.
Figure 24-7.
Creating entity classes using the LINQ to SQL designer
Once you perform your initial compile, go to the Solution Explorer and open the related *.cs
file (see Figure 24-8). As you look over the generated C# code, you’ll quickly notice it is the same
overall code generated by the sqlmetal.exe command-line utility. Also note that the visual LINQ to
SQL designer added an app.config file to your project to store the necessary connection string data.
Figure 24-8.
The generated namespace with the contained types
C H A P T E R 2 4
■
P R O G R A M M I N G W I T H T H E L I N Q A P I S
855
8849CH24.qxd 10/19/07 10:11 AM Page 855
Now that all the generated
types are accounted for, here is a Program class
that illustrates insert-
ing, updating, and deleting data on the Inventory table.
Do'stlaringiz bilan baham: