Data context class is a LINQ to SQL class that acts as a medium between a SQL server database and LINQ to SQL entities classes mapped to that database. It has following responsibilities:
1. Contains the connection string information, methods to connect to the database and manipulating the data in the database.
2. Contains several methods that send updated data from LINQ to SQL entity classes to the database.
3. Methods can also be mapped to stored procedures and functions.
4. With data context, we can perform select, insert, update and delete operations over the data in the database.
Hair Building Fiber
Step Up Height Increaser
The DataContext is the source of all entities mapped over a database connection. It tracks changes that you made to all retrieved entities and maintains an "identity cache" that guarantees that entities retrieved more than one time are represented by using the same object instance.
In general, a DataContext instance is designed to last for one "unit of work" however your application defines that term. A DataContext is lightweight and is not expensive to create. A typical LINQ to SQL application creates DataContext instances at method scope or as a member of short-lived classes that represent a logical set of related database operations.
Best Orthodontist in Delhi | Dentist in Delhi
Last edited by Kiran674; 03-28-2016 at 05:57 AM.