What is Datacontext Class in C#

The DataContext class is a LINQ to SQL class that acts as a conduit between a SQL Server database and the LINQ to SQL entity classes mapped to that database.

The DataContext class contains methods and properties for connecting to a database and manipulating the data in the database.

By default, the DataContext class contains several methods that you can call (for example, SubmitChanges). You can also create additional DataContext methods that map to stored procedures and functions.

In other words, calling these custom methods will run the stored procedure or function in the database that the DataContext method is mapped to.

You can definitely add new methods to the DataContext class just as you would add methods to extend any class. However, in discussions about DataContext methods in the context of the O/R Designer.

Comments

Popular posts from this blog

OutSystems – A Low-code Development Platform

What is difference between Azure Cognitive Search and Elastic Search

failed to access iis metabase asp.net