Export (0) Print
Expand All

ObjectContext Methods

The ObjectContext type exposes the following members.

  Name Description
Public method AcceptAllChanges Accepts all changes made to objects in the object context.
Public method AddObject Adds an object to the object context.
Public method ApplyCurrentValues<TEntity> Copies the scalar values from the supplied object into the object in the ObjectContext that has the same key.
Public method ApplyOriginalValues<TEntity> Copies the scalar values from the supplied object into set of original values for the object in the ObjectContext that has the same key.
Public method ApplyPropertyChanges Obsolete. Applies property changes from a detached object to an object already attached to the object context.
Public method Attach Attaches an object or object graph to the object context when the object has an entity key.
Public method AttachTo Attaches an object or object graph to the object context in a specific entity set.
Public method CreateDatabase Creates the database by using the current data source connection and the metadata in the StoreItemCollection.
Public method CreateDatabaseScript Generates a data definition language (DDL) script that creates schema objects (tables, primary keys, foreign keys) for the metadata in the StoreItemCollection. The StoreItemCollection loads metadata from store schema definition language (SSDL) files.
Public method CreateEntityKey Creates the entity key for a specific object, or returns the entity key if it already exists.
Public method CreateObject<T> Creates and returns an instance of the requested type .
Public method CreateObjectSet<TEntity>() Creates a new ObjectSet<TEntity> instance that is used to query, add, modify, and delete objects of the specified entity type.
Public method CreateObjectSet<TEntity>(String) Creates a new ObjectSet<TEntity> instance that is used to query, add, modify, and delete objects of the specified type and with the specified entity set name.
Public method CreateProxyTypes Generates an equivalent type that can be used with the Entity Framework for each type in the supplied enumeration.
Public method CreateQuery<T> Creates an ObjectQuery<T> in the current object context by using the specified query string.
Public method DatabaseExists Checks if the database that is specified as the database in the current data source connection exists on the data source.
Public method DeleteDatabase Deletes the database that is specified as the database in the current data source connection.
Public method DeleteObject Marks an object for deletion.
Public method Detach Removes the object from the object context.
Public method DetectChanges Ensures that ObjectStateEntry changes are synchronized with changes in all objects that are tracked by the ObjectStateManager.
Public method Dispose() Releases the resources used by the object context.
Protected method Dispose(Boolean) Releases the resources used by the object context.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method ExecuteFunction(String, ObjectParameter[]) Executes a stored procedure or function that is defined in the data source and expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution.
Public method ExecuteFunction<TElement>(String, ObjectParameter[]) Executes a stored procedure or function that is defined in the data source and mapped in the conceptual model, with the specified parameters. Returns a typed ObjectResult<T>.
Public method ExecuteFunction<TElement>(String, MergeOption, ObjectParameter[]) Executes the given stored procedure or function that is defined in the data source and expressed in the conceptual model, with the specified parameters, and merge option. Returns a typed ObjectResult<T>.
Public method ExecuteStoreCommand Executes an arbitrary command directly against the data source using the existing connection.
Public method ExecuteStoreQuery<TElement>(String, Object[]) Executes a query directly against the data source that returns a sequence of typed results.
Public method ExecuteStoreQuery<TEntity>(String, String, MergeOption, Object[]) Executes a query directly against the data source and returns a sequence of typed results. Specify the entity set and the merge option so that query results can be tracked as entities.
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 GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method Static member GetKnownProxyTypes Returns all the existing proxy types.
Public method GetObjectByKey Returns an object that has the specified entity key.
Public method Static member GetObjectType Returns the entity type of the POCO entity associated with a proxy object of a specified type.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method LoadProperty(Object, String) Explicitly loads an object related to the supplied object by the specified navigation property and using the default merge option.
Public method LoadProperty(Object, String, MergeOption) Explicitly loads an object that is related to the supplied object by the specified navigation property and using the specified merge option.
Public method LoadProperty<TEntity>(TEntity, Expression<Func<TEntity, Object>>) Explicitly loads an object that is related to the supplied object by the specified LINQ query and by using the default merge option.
Public method LoadProperty<TEntity>(TEntity, Expression<Func<TEntity, Object>>, MergeOption) Explicitly loads an object that is related to the supplied object by the specified LINQ query and by using the specified merge option.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Refresh(RefreshMode, IEnumerable) Updates a collection of objects in the object context with data from the data source.
Public method Refresh(RefreshMode, Object) Updates an object in the object context with data from the data source.
Public method SaveChanges() Persists all updates to the data source and resets change tracking in the object context.
Public method SaveChanges(Boolean) Obsolete. Persists all updates to the data source and optionally resets change tracking in the object context.
Public method SaveChanges(SaveOptions) Persists all updates to the data source with the specified SaveOptions.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Translate<TElement>(DbDataReader) Translates a DbDataReader that contains rows of entity data to objects of the requested entity type.
Public method Translate<TEntity>(DbDataReader, String, MergeOption) Translates a DbDataReader that contains rows of entity data to objects of the requested entity type, in a specific entity set, and with the specified merge option.
Public method TryGetObjectByKey Returns an object that has the specified entity key.
Top
Show:
© 2014 Microsoft