Export (0) Print
Expand All
Expand Minimize

System.Data.Entity Namespace

Entity Framework 5.0

Contains classes that provide access to the core functionality of the Entity Framework. These classes enable you to query, insert, update, and delete data by working with strongly typed CLR objects.

  Class Description
Public class CreateDatabaseIfNotExists<TContext> An implementation of IDatabaseInitializer<TContext> that will recreate and optionally re-seed the database with data only if the database does not exist. To seed the database, create a derived class and override the Seed method.
Public class Database An instances of this class is obtained from an DbContext object and can be used to manage the actual database backing a DbContext or connection. This includes creating, deleting, and checking for the existence of a database. Deletion and checking for existence of a database can be performed using just a connection (without a full context) by using the static methods of this class.
Public class DbContext Represents a combination of the Unit-Of-Work and Repository patterns and enables you to query a database and group together changes that will then be written back to the store as a unit. DbContext is conceptually similar to ObjectContext.
Public class DbExtensions Contains a set of extension methods to help with common tasks.
Public class DbModelBuilder DbModelBuilder is used to map CLR classes to a database schema. This code centric approach to building an Entity Data Model (EDM) model is known as Code First.
Public class DbModelBuilderVersionAttribute This attribute can be applied to a class derived from DbContext to set which version of the DbContext and DbModelBuilder conventions should be used when building a model from code. See the DbModelBuilderVersion enumeration for details about DbModelBuilder versions.
Public class DbSet Represents an entity set that is used to perform create, read, update, and delete operations. A non-generic version of DbSet<TEntity> which can be used when the type of entity is not known at build time.
Public class DbSet<TEntity> Represents a typed entity set that is used to perform create, read, update, and delete operations. DbSet is not publicly constructible and can only be created from a DbContext instance.
Public class DropCreateDatabaseAlways<TContext> An implementation of IDatabaseInitializer<TContext> that will always recreate and optionally re-seed the database with data the first time that a context is used in the application domain. To seed the database, create a derived class and override the Seed method.
Public class DropCreateDatabaseIfModelChanges<TContext> An implementation of IDatabaseInitializer<TContext>that will delete, recreate, and optionally re-seed the database with data only if the model has changed since the database was created. This is achieved by writing a hash of the store model to the database when it is created and then comparing that hash with one generated from the current model. To seed the database, create a derived class and override the Seed method.
Public class MigrateDatabaseToLatestVersion<TContext, TMigrationsConfiguration> An implementation of IDatabaseInitializer that will use Code First Migrations to update the database to the latest migration.

  Interface Description
Public interface IDatabaseInitializer<TContext> Defines a method for the database initializer.
Public interface IDbSet<TEntity> Represents the collection of all entities in the context, or that can be queried from the database, of a given type. DbSet is a concrete implementation of IDbSet<TEntity>.

  Enumeration Description
Public enumeration DbModelBuilderVersion A value from this enumeration can be provided directly to the DbModelBuilder class or can be used in the DbModelBuilderVersionAttribute applied to a class derived from DbContext. The value used defines which version of the DbContext and DbModelBuilder conventions should be used when building a model from code.
Show:
© 2014 Microsoft