Building Entities by Hand
Before you can start performing queries using LINQ to SQL, you need to create one or more entity classes that represent the data you are querying. In this section, you learn how to code these classes by hand.
Imagine that you have the following database table named Movie that you want to perform queries against:
You can use the class in Listing 20.11 to represent this table.
Listing 20.11. Entities\App_Code\Movie.cs
The class in Listing 20.11 contains a property that corresponds to each column in the Movie database table. ...
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.