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.
In Part 2 of this series I walked through how to create a LINQ to SQL class model using the LINQ to SQL designer that is built-into VS 2008.
First, we will have to retrieve the ‘user’ object we want to delete, and then add this deletion operation in the queue by ‘Delete On Submit’ method.
Finally commit the operation using ‘Submit Changes’ method as before; Just like insert operation, this delete operation example given above will work for .
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.