Building Entities with the LINQ to SQL Designer
As an alternative to building entities by hand, you can use the LINQ to SQL Designer. You can simply drag database tables from the Database Explorer (Server Explorer) onto the Designer. The Designer generates the entity classes with the correct attributes automatically.
Follow these steps to use the LINQ to SQL Designer:
- Select Website, Add New Item to open the Add New Item dialog box.
- Select the LINQ to SQL Classes template, give it the name MyDatabase, and click the Add button.
- When prompted to create the LINQ to SQL classes in the App_Code folder, click the Yes button.
- After the LINQ to SQL Designer opens, drag one or more database tables from the Database Explorer/Server Explorer window onto ...
Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.