DataContext Methods

The DataContext type exposes the following members.

  Name Description
Public method CreateDatabase Creates a database on the server.
Protected method CreateMethodCallQuery<TResult> Infrastructure. Executes the table-valued database function associated with the specified CLR method.
Public method DatabaseExists Determines whether the associated database can be opened.
Public method DeleteDatabase Deletes the associated database.
Public method Dispose() Releases all resources used by the current instance of the DataContext class.
Protected method Dispose(Boolean) Releases the unmanaged resources used by the DataContext class and optionally releases the managed resource.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method ExecuteCommand Executes SQL commands directly on the database.
Protected method ExecuteDynamicDelete Executes, inside delete override methods, to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for delete operations.
Protected method ExecuteDynamicInsert Executes, inside insert override methods, to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for insert operations.
Protected method ExecuteDynamicUpdate Executes, inside update override methods, to redelegate to LINQ to SQL the task of generating and executing dynamic SQL for update operations.
Protected method ExecuteMethodCall Infrastructure. Executes the stored database procedure or scalar function associated with the specified CLR method.
Public method ExecuteQuery(Type, String, Object[]) Executes SQL queries directly on the database.
Public method ExecuteQuery<TResult>(String, Object[]) Executes SQL queries directly on the database and returns objects.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetChangeSet Gets the modified objects tracked by DataContext.
Public method GetCommand Gets the information about SQL commands generated by LINQ to SQL.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetTable(Type) Returns a collection of objects of a particular type, where the type is defined by the type parameter.
Public method GetTable<TEntity>() Returns a collection of objects of a particular type, where the type is defined by the TEntity parameter.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Refresh(RefreshMode, IEnumerable) Refreshes a collection of entity objects according to the specified mode.
Public method Refresh(RefreshMode, Object) Refreshes an entity object according to the specified mode.
Public method Refresh(RefreshMode, Object[]) Refreshes an array of entity objects according to the specified mode.
Public method SubmitChanges() Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.
Public method SubmitChanges(ConflictMode) Sends changes that were made to retrieved objects to the underlying database, and specifies the action to be taken if the submission fails.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Translate(DbDataReader) Converts an existing DbDataReader to objects.
Public method Translate(Type, DbDataReader) Converts an existing DbDataReader to objects.
Public method Translate<TResult>(DbDataReader) Converts an existing DbDataReader to objects.
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft