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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access