C# Class ODataRestierDynamic.Models.DynamicContext

A DynamicContext instance represents a combination of the Unit Of Work and Repository patterns such that it can be used to query from a database and group together changes that will then be written back to the store as a unit. DynamicContext is conceptually similar to DbContext.
Inheritance: DbContext
显示文件 Open project: arcelormittalkriviyrih/odata_unified_svc

Public Methods

Method Description
GetModelType ( string name ) : Type

Gets model type.

LogQuery ( string query ) : void

Logs a query.

SaveChangesAsync ( System cancellationToken ) : System.Threading.Tasks.Task

Saves the changes asynchronous.

TryGetRelevantType ( string name, Type &relevantType ) : bool

Attempts to get relevant type from the given data.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes the context. The underlying T:System.Data.Entity.Core.Objects.ObjectContext is also disposed if it was created is by this context or ownership was passed to this context when this context was created. The connection to the database (T:System.Data.Common.DbConnection object) is also disposed if it was created is by this context or ownership was passed to this context when this context was created.

OnModelCreating ( DbModelBuilder modelBuilder ) : void

This method is called when the model for a derived context has been initialized, but before the model has been locked down and used to initialize the context. The default implementation of this method does nothing, but it can be overridden in a derived class such that the model can be further configured before it is locked down.

Private Methods

Method Description
AddActionsToModel ( DbModelBuilder modelBuilder, DatabaseSchemaReader.DataSchema.DatabaseSchema schema, DynamicClassFactory dynamicClassFactory ) : void

Adds the actions to model.

AddViewToModel ( DbModelBuilder modelBuilder, DynamicClassFactory dynamicClassFactory, List failedViewColumns, DatabaseSchemaReader.DataSchema.DatabaseView view ) : Type

Adds a view to model.

CreateModel ( ) : DbCompiledModel

Creates the model.

CreateType ( DynamicClassFactory dynamicClassFactory, string name, DynamicPropertyData>.Dictionary property ) : Type

Creates a type.

CreateTypeAction ( DynamicClassFactory dynamicClassFactory, string name, DynamicMethodData>.Dictionary methods ) : Type

Creates type action.

CreateTypeBuilder ( DynamicClassFactory dynamicClassFactory, string name, DynamicPropertyData>.Dictionary property ) : TypeBuilder

Creates a type builder.

DynamicContext ( ) : System

Static constructor.

GetNextID ( string sequenceScript ) : int

Gets the next identifier.

Method Details

Dispose() protected method

Disposes the context. The underlying T:System.Data.Entity.Core.Objects.ObjectContext is also disposed if it was created is by this context or ownership was passed to this context when this context was created. The connection to the database (T:System.Data.Common.DbConnection object) is also disposed if it was created is by this context or ownership was passed to this context when this context was created.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only unmanaged resources.
return void

GetModelType() public method

Gets model type.
public GetModelType ( string name ) : Type
name string The name.
return System.Type

LogQuery() public method

Logs a query.
public LogQuery ( string query ) : void
query string The query.
return void

OnModelCreating() protected method

This method is called when the model for a derived context has been initialized, but before the model has been locked down and used to initialize the context. The default implementation of this method does nothing, but it can be overridden in a derived class such that the model can be further configured before it is locked down.
Thrown when an Unintentional Code First /// error condition occurs.
protected OnModelCreating ( DbModelBuilder modelBuilder ) : void
modelBuilder DbModelBuilder The builder that defines the model for the context being created.
return void

SaveChangesAsync() public method

Saves the changes asynchronous.
public SaveChangesAsync ( System cancellationToken ) : System.Threading.Tasks.Task
cancellationToken System A to /// observe while waiting for the task to complete.
return System.Threading.Tasks.Task

TryGetRelevantType() public method

Attempts to get relevant type from the given data.
public TryGetRelevantType ( string name, Type &relevantType ) : bool
name string The name.
relevantType System.Type [out] Type of the relevant.
return bool