LINQ Code

Let’s examine exactly what has taken place behind the scenes as a result of the drag-and-drop operation between Server Explorer and the O/R designer.

For one, the connection string necessary to open a connection to the selected database is automatically stored in the app.config (or web.config) file for you. This is then leveraged by LINQ to make calls into the database when needed. In addition, a new class has been defined, in this case one named PurchaseOrderHeader.

Note

The O/R designer actually “depluralizes” entity names for you automatically. Many HR databases, for instance, choose to implement an employee table and call it Employees because it stores the data records for more than one worker. In an attempt to further push through ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition 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.