Export (0) Print
Expand All
Expand Minimize

System.Data.Entity.Infrastructure Namespace

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

The System.Data.Entity.Infrastructure namespace contains classes that support core Entity Framework functionality.

  ClassDescription
Public classCommitFailedExceptionThe exception that is thrown when an error occurs committing a DbTransaction.
Public classCommitFailureHandlerRepresents a transaction handler that allows graceful recovery from connection failures during transaction commit by storing transaction tracing information in the database. It needs to be registered by using SetDefaultTransactionHandler(Func<TransactionHandler>).
Public classDbChangeTrackerReturned by the ChangeTracker method of DbContext to provide access to features of the context that are related to change tracking of entities.
Public classDbCollectionEntryRepresents a non-generic version of the DbCollectionEntry<TEntity, TElement> class.
Public classDbCollectionEntry<TEntity, TElement>Instances of this class are returned from the Collection method of DbEntityEntry<TEntity> and allow operations such as loading to be performed on the an entity's collection navigation properties.
Public classDbCompiledModelAn immutable representation of an Entity Data Model (EDM) model that can be used to create an ObjectContext or can be passed to the constructor of a DbContext. For increased performance, instances of this type should be cached and re-used to construct contexts.
Public classDbComplexPropertyEntryA non-generic version of the DbComplexPropertyEntry<TEntity, TComplexProperty> class.
Public classDbComplexPropertyEntry<TEntity, TComplexProperty>Instances of this class are returned from the ComplexProperty method of DbEntityEntry<TEntity> and allow access to the state of a complex property.
Public classDbConnectionInfoRepresents information about a database connection.
Public classDbContextConfigurationReturned by the Configuration method of DbContext to provide access to configuration options for the context.
Public classDbContextInfoProvides runtime information about a given DbContext type.
Public classDbEntityEntryA non-generic version of the DbEntityEntry<TEntity> class.
Public classDbEntityEntry<TEntity>Instances of this class provide access to information about and control of entities that are being tracked by the DbContext. Use the Entity or Entities methods of the context to obtain objects of this type.
Public classDbExecutionStrategyProvides the base implementation of the retry mechanism for unreliable operations and transient conditions that uses exponentially increasing delays between retries.
Public classDbMemberEntryThis is an abstract base class use to represent a scalar or complex property, or a navigation property of an entity. Scalar and complex properties use the derived class DbPropertyEntry, reference navigation properties use the derived class DbReferenceEntry, and collection navigation properties use the derived class DbCollectionEntry.
Public classDbMemberEntry<TEntity, TProperty>This is an abstract base class use to represent a scalar or complex property, or a navigation property of an entity. Scalar and complex properties use the derived class DbPropertyEntry<TEntity, TProperty>, reference navigation properties use the derived class DbReferenceEntry<TEntity, TProperty>, and collection navigation properties use the derived class DbCollectionEntry<TEntity, TElement>.
Public classDbModelRepresents an Entity Data Model (EDM) created by the DbModelBuilder. The Compile method can be used to go from this EDM representation to a DbCompiledModel which is a compiled snapshot of the model suitable for caching and creation of DbContext or ObjectContext instances.
Public classDbPropertyEntryA non-generic version of the DbPropertyEntry<TEntity, TProperty> class.
Public classDbPropertyEntry<TEntity, TProperty>Instances of this class are returned from the Property method of DbEntityEntry<TEntity> and allow access to the state of the scalar or complex property.
Public classDbPropertyValuesA collection of all the properties for an underlying entity or complex object.
Public classDbProviderInfoGroups a pair of strings that identify a provider and server version together into a single object.
Public classDbQueryRepresents a non-generic LINQ to Entities query against a DbContext.
Public classDbQuery<TResult>Represents a LINQ to Entities query against a DbContext.
Public classDbRawSqlQueryRepresents a SQL query for non-entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the Database instance. The query is not executed when this object is created; it is executed each time it is enumerated, for example by using foreach. SQL queries for entities are created using SqlQuery(String, Object[]). See DbRawSqlQuery<TElement> for a generic version of this class.
Public classDbRawSqlQuery<TElement>Represents a SQL query for non-entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the Database instance. The query is not executed when this object is created; it is executed each time it is enumerated, for example by using foreach. SQL queries for entities are created using SqlQuery(String, Object[]). See DbRawSqlQuery for a non-generic version of this class.
Public classDbReferenceEntryA non-generic version of the DbReferenceEntry<TEntity, TProperty> class.
Public classDbReferenceEntry<TEntity, TProperty>Instances of this class are returned from the Reference method of DbEntityEntry<TEntity> and allow operations such as loading to be performed on the an entity's reference navigation properties.
Public classDbSqlQueryRepresents a SQL query for entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the DbSet instance for the entity type. The query is not executed when this object is created; it is executed each time it is enumerated, for example by using foreach. SQL queries for non-entities are created using SqlQuery(Type, String, Object[]). See DbSqlQuery<TEntity> for a generic version of this class.
Public classDbSqlQuery<TEntity>Represents a SQL query for entities that is created from a DbContext and is executed using the connection from that context. Instances of this class are obtained from the DbSet<TEntity> instance for the entity type. The query is not executed when this object is created; it is executed each time it is enumerated, for example by using foreach. SQL queries for non-entities are created using SqlQuery<TElement>(String, Object[]). See DbSqlQuery for a non-generic version of this class.
Public classDbUpdateConcurrencyExceptionException thrown by DbContext when it was expected that SaveChanges for an entity would result in a database update but in fact no rows in the database were affected. This usually indicates that the database has been concurrently updated such that a concurrency token that was expected to match did not actually match. Note that state entries referenced by this exception are not serialized due to security and accesses to the state entries after serialization will return null.
Public classDbUpdateExceptionException thrown by DbContext when the saving of changes to the database fails. Note that state entries referenced by this exception are not serialized due to security and accesses to the state entries after serialization will return null.
Public classDefaultExecutionStrategyRepresents the default IDbExecutionStrategy that doesn't retry operations if they fail.
Public classDefaultManifestTokenResolverRepresents a default implementation of IManifestTokenResolver that uses the underlying provider to get the manifest token. Note that to avoid multiple queries, this implementation using caching based on the actual type of DbConnection instance, the DataSource property, and the Database property.
Public classEdmMetadata Obsolete. Represents an entity used to store metadata about an EDM in the database.
Public classEdmxWriterContains methods used to access the Entity Data Model created by Code First in the EDMX form. These methods are typically used for debugging when there is a need to look at the model that Code First creates internally.
Public classExecutionStrategyKeyA key used for resolving Func<TResult>. It consists of the ADO.NET provider invariant name and the database server name as specified in the connection string.
Public classIncludeMetadataConvention Obsolete. This DbModelBuilder convention causes DbModelBuilder to include metadata about the model when it builds the model. When DbContext creates a model by convention it will add this convention to the list of those used by the DbModelBuilder. This will then result in model metadata being written to the database if the DbContext is used to create the database. This can then be used as a quick check to see if the model has changed since the last time it was used against the database. This convention can be removed from the DbModelBuilder conventions by overriding the OnModelCreating method on a derived DbContext class.
Public classLocalDbConnectionFactoryInstances of this class are used to create DbConnection objects for SQL Server LocalDb based on a given database name or connection string.
Public classModelContainerConventionThis DbModelBuilder convention uses the name of the derived DbContext class as the container for the conceptual model built by Code First.
Public classModelNamespaceConventionThis DbModelBuilder convention uses the namespace of the derived DbContext class as the namespace of the conceptual model built by Code First.
Public classObjectReferenceEqualityComparerCompares objects using reference equality.
Public classReplacementDbQueryWrapper<TElement>Instances of this class are used internally to create constant expressions for ObjectQuery<T> that are inserted into the expression tree to replace references to DbQuery<TResult> and DbQuery.
Public classRetryLimitExceededExceptionThe exception that is thrown when the action failed again after being retried the configured number of times.
Public classSqlCeConnectionFactoryInstances of this class are used to create DbConnection objects for SQL Server Compact Edition based on a given database name or connection string.
Public classSqlConnectionFactoryInstances of this class are used to create DbConnection objects for SQL Server based on a given database name or connection string. By default, the connection is made to '.\SQLEXPRESS'. This can be changed by changing the base connection string when constructing a factory instance.
Public classSuppressDbSetInitializationAttributeThis attribute can be applied to either an entire derived DbContext class or to individual DbSet<TEntity> or IDbSet<TEntity> properties on that class. When applied any discovered DbSet<TEntity> or IDbSet<TEntity> properties will still be included in the model but will not be automatically initialized.
Public classTableExistenceCheckerImplemented by Entity Framework providers and used to check whether or not tables exist in a given database. This is used by database initializers when determining whether or not to treat an existing database as empty such that tables should be created.
Public classTransactionContextThis class is used by CommitFailureHandler to write and read transaction tracing information from the database. To customize the definition of the transaction table you can derive from this class and override OnModelCreating(DbModelBuilder). Derived classes can be registered using DbConfiguration.
Public classTransactionHandlerRepresents the base class for interceptors that handle the transaction operations. Derived classes can be registered using SetDefaultTransactionHandler(Func<TransactionHandler>) or SetTransactionHandler(String, Func<TransactionHandler>, String).
Public classTransactionRowRepresents a transaction.
Public classUnintentionalCodeFirstExceptionThrown when a context is generated from the DbContext templates in Database First or Model First mode and is then used in Code First mode.

  InterfaceDescription
Public interfaceIDbAsyncEnumerableAsynchronous version of the IEnumerable interface that allows elements to be retrieved asynchronously. This interface is used to interact with Entity Framework queries and shouldn't be implemented by custom classes.
Public interfaceIDbAsyncEnumerable<T>Asynchronous version of the IEnumerable<T> interface that allows elements of the enumerable sequence to be retrieved asynchronously. This interface is used to interact with Entity Framework queries and shouldn't be implemented by custom classes.
Public interfaceIDbAsyncEnumeratorAsynchronous version of the IEnumerator interface that allows elements to be retrieved asynchronously. This interface is used to interact with Entity Framework queries and shouldn't be implemented by custom classes.
Public interfaceIDbAsyncEnumerator<T>Asynchronous version of the IEnumerator<T> interface that allows elements to be retrieved asynchronously. This interface is used to interact with Entity Framework queries and shouldn't be implemented by custom classes.
Public interfaceIDbAsyncQueryProviderDefines methods to create and asynchronously execute queries that are described by an IQueryable object. This interface is used to interact with Entity Framework queries and shouldn't be implemented by custom classes.
Public interfaceIDbConnectionFactoryImplementations of this interface are used to create DbConnection objects for a type of database server based on a given database name. An Instance is set on the Database class to cause all DbContexts created with no connection information or just a database name or connection string to use a certain type of database server by default. Two implementations of this interface are provided: SqlConnectionFactory is used to create connections to Microsoft SQL Server, including EXPRESS editions. SqlCeConnectionFactory is used to create connections to Microsoft SQL Server Compact Editions. Other implementations for other database servers can be added as needed. Note that implementations should be thread safe or immutable since they may be accessed by multiple threads at the same time.
Public interfaceIDbContextFactory<TContext>A factory for creating derived DbContext instances. Implement this interface to enable design-time services for context types that do not have a public default constructor. At design-time, derived DbContext instances can be created in order to enable specific design-time experiences such as model rendering, DDL generation etc. To enable design-time instantiation for derived DbContext types that do not have a public, default constructor, implement this interface. Design-time services will auto-discover implementations of this interface that are in the same assembly as the derived DbContext type.
Public interfaceIDbExecutionStrategyA strategy that is used to execute a command or query against the database, possibly with logic to retry when a failure occurs.
Public interfaceIDbModelCacheKeyRepresents a key value that uniquely identifies an Entity Framework model that has been loaded into memory.
Public interfaceIDbModelCacheKeyProviderImplement this interface on your context to use custom logic to calculate the key used to lookup an already created model in the cache. This interface allows you to have a single context type that can be used with different models in the same AppDomain, or multiple context types that use the same model.
Public interfaceIDbProviderFactoryResolverA service for obtaining the correct DbProviderFactory from a given DbConnection.
Public interfaceIManifestTokenResolverA service for getting a provider manifest token given a connection. The DefaultManifestTokenResolver class is used by default and makes use of the underlying provider to get the token which often involves opening the connection. A different implementation can be used instead by adding an IDbDependencyResolver to DbConfiguration that may use any information in the connection to return the token. For example, if the connection is known to point to a SQL Server 2008 database then "2008" can be returned without opening the connection.
Public interfaceIMetadataAnnotationSerializerImplement this interface to allow custom annotations represented by MetadataProperty instances to be serialized to and from the EDMX XML. Usually a serializer instance is set using the SetMetadataAnnotationSerializer(String, Func<IMetadataAnnotationSerializer>) method.
Public interfaceIObjectContextAdapterInterface implemented by objects that can provide an ObjectContext instance. The DbContext class implements this interface to provide access to the underlying ObjectContext.
Public interfaceIProviderInvariantNameUsed by IDbDependencyResolver and DbConfiguration when resolving a provider invariant name from a DbProviderFactory.

  EnumerationDescription
Public enumerationDbConnectionStringOriginDescribes the origin of the database connection string associated with a DbContext.
Show:
© 2014 Microsoft