Below is a class model created for the Northwind sample database and which I'll be using in this blog post: When we designed our data model using the LINQ to SQL data designer above we defined five data model classes: Product, Category, Customer, Order and Order Detail.The properties of each class map to the columns of a corresponding table in the database.Each instance of a class entity represents a row within the database table.When we defined our data model, the LINQ to SQL designer also created a custom Data Context class that provides the main conduit by which we'll query our database and apply updates/changes.But if there are a large number of rows that require an update, then the overhead of issuing large numbers of UPDATE statements can result in the operation as a whole taking a long time to complete.The traditional advice for improving performance for multiple UPDATE statements is to “prepare” the required query once, and then “execute” the prepared query once for each row requiring an update.For more information, see Responsibilities of the Developer In Overriding Default Behavior.
LINQ to SQL is a built-in O/RM (object relational mapper) that ships in the .
LINQ to SQL offers maximum flexibility in manipulating and persisting changes that you made to your objects.
As soon as entity objects are available (either by retrieving them through a query or by constructing them anew), you can change them as typical objects in your application.
If data is changing in the underlying table, the same change is reflected in the view.
A view can be built on top of a single table or multiple tables. In the SQL Create View page, we will see how a view can be built. Ease of use: A view hides the complexity of the database tables from end users.
A view consists of rows and columns just like a table.