DataContext Class Members
In This Topic
The following tables list the members exposed by DataContext.
Public Constructors
Public Properties
| Name | Description |
| ChangeConflicts | Returns a collection of objects that caused concurrency conflicts when SubmitChanges was called. |
| CommandTimeout | Increases the time-out period for queries that would otherwise time out during the default time-out period. |
| Connection | Returns the connection used by the framework. |
| DeferredLoadingEnabled | Instructs the framework not to delay-load one-to-many or one-to-one relationships. |
| EntityCachingMode | Determines how context's entity cache works. |
| Errors | Gets the collection of errors, occurred while performing the SubmitChanges operation and not processed in the OnSubmitError event. |
| HasErrors | Indicates whether there are unprocessed errors, occurred during SubmitChanges operation. |
| LoadOptions | Gets or sets the DataLoadOptions associated with this DataContext. |
| Log | Prints the SQL query or command to the TextReader. |
| Mapping | Returns the MetaModel on which the mapping is based. |
| MaxBatchSize | Gets or sets the max number of queries, united in the batch for speeding up the SubmitChanges operation. |
| MaxUsedConnections | Gets or sets the maximal number of opened connections. |
| ObjectTrackingEnabled | Instructs the framework to track the original value and object identity for this DataContext. |
| Transaction | Sets a local transaction for the .NET Framework to use to access the database. |
Top
Public Methods
| Name | Description |
| CreateDatabase | Overloaded. Creates and executes script that creates database tables with their constraints, indexes, and foreign keys. |
| DatabaseExists | Returns true if an attempt to open the database by using the connection in the DataContext succeeds. |
| DeleteDatabase | Overloaded. Creates and executes script that deletes database tables with their constraints, indexes, and foreign keys. |
| Dispose | Releases all resources used by the DataContext. |
| ExecuteCommand | Executes SQL commands directly on the database. |
| ExecuteQuery | Overloaded. Executes SQL queries directly on the database. |
| GetChangeSet | Provides access to the modified objects tracked by DataContext. |
| GetCommand | Provides information about SQL commands generated by LINQ to SQL. |
| GetTable | Overloaded. Returns a collection of table objects. |
| Query<TResult> | Executes SQL query against the database, with data fetching delayed until they will be accessed through the IQueryable interface. |
| Refresh | Overloaded. Refreshes object state by using data in the database. |
| RejectChanges | Cancels all unsubmitted changes to the DataContext entities. |
| SubmitChanges | Overloaded. Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database. |
| Translate | Overloaded. Converts an existing IDataReader to objects. |
Top
See Also