Метод | Описание | |
---|---|---|
CreateModel ( |
Creates an immutable, cacheable representation of the model defined by this builder. This model can be used to create an ObjectContext or can be passed to a DbContext constructor to create a DbContext for this model.
|
|
CreateModelBuilder ( ) : DbModelBuilder |
Creates and configures the DbModelBuilder instance that will be used to build the DbCompiledModel.
|
|
DisposeContext ( bool disposing ) : void |
Disposes the context. The underlying ObjectContext is also disposed. The connection to the database (DbConnection object) is also disposed if it was created by the context, otherwise it is not disposed.
|
|
GetObjectContextWithoutDatabaseInitialization ( ) : ObjectContext |
Returns the underlying ObjectContext without causing the underlying database to be created or the database initialization strategy to be executed. This is used to get a context that can then be used for database creation/initialization.
|
|
LazyInternalContext ( DbContext owner, IInternalConnection internalConnection, DbCompiledModel model, IDbModelCacheKey>.Func |
Constructs a LazyInternalContext for the given DbContext owner that will be initialized on first use.
|
|
MarkDatabaseInitialized ( ) : void |
Marks the database as having been initialized without actually running the
|
|
MarkDatabaseNotInitialized ( ) : void |
Marks the database as having not been initialized. This is called when the app calls Database.Delete so that the database if the app attempts to then use the database again it will be re-initialized automatically.
|
|
OverrideConnection ( IInternalConnection connection ) : void | ||
SaveChanges ( ) : int |
Saves all changes made in this context to the underlying database, but only if the context has been initialized. If the context has not been initialized, then this method does nothing because there is nothing to do; in particular, it does not cause the context to be initialized.
|
|
SaveChangesAsync ( |
Метод | Описание | |
---|---|---|
InitializeContext ( ) : void |
Initializes the underlying ObjectContext.
|
|
InitializeDatabase ( ) : void |
Runs the IDatabaseInitializer{TContext} unless it has already been run or there is no initializer for this context type in which case this method does nothing.
|
Метод | Описание | |
---|---|---|
InitializeDatabaseAction ( Action |
Performs some action (which may do nothing) in such a way that it is guaranteed only to be run once for the model and connection in this app domain, unless it fails by throwing an exception, in which case it will be re-tried next time the context is initialized.
|
|
StripInvalidCharacters ( string value ) : string |
public static CreateModel ( |
||
internalContext | ||
Результат | DbCompiledModel |
public CreateModelBuilder ( ) : DbModelBuilder | ||
Результат | DbModelBuilder |
public DisposeContext ( bool disposing ) : void | ||
disposing | bool | |
Результат | void |
public GetObjectContextWithoutDatabaseInitialization ( ) : ObjectContext | ||
Результат | ObjectContext |
public LazyInternalContext ( DbContext owner, IInternalConnection internalConnection, DbCompiledModel model, IDbModelCacheKey>.Func |
||
owner | DbContext |
// The owner |
internalConnection | IInternalConnection | Responsible for creating a connection lazily when the context is used for the first time. |
model | DbCompiledModel | The model, or null if it will be created by convention |
cacheKeyFactory | IDbModelCacheKey>.Func | |
attributeProvider | System.Data.Entity.ModelConfiguration.Utilities.AttributeProvider | |
dispatchers | Lazy |
|
objectContext | ObjectContext | |
Результат | System.Collections.Concurrent |
public MarkDatabaseNotInitialized ( ) : void | ||
Результат | void |
public OverrideConnection ( IInternalConnection connection ) : void | ||
connection | IInternalConnection | |
Результат | void |
public SaveChangesAsync ( |
||
cancellationToken | ||
Результат | Task |