C# Class Rock.Data.DbContext

Entity Framework Context
Inheritance: System.Data.Entity.DbContext
Afficher le fichier Open project: SparkDevNetwork/Rock Class Usage Examples

Méthodes publiques

Méthode Description
DbContext ( ) : System

Initializes a new instance of the DbContext class.

DbContext ( string nameOrConnectionString ) : System

Initializes a new instance of the DbContext class.

SaveChanges ( ) : int

Saves all changes made in this context to the underlying database.

SaveChanges ( bool disablePrePostProcessing ) : int

Saves all changes made in this context to the underlying database. The default pre and post processing can also optionally be disabled. This would disable audit records being created, workflows being triggered, and any PreSaveChanges() methods being called for changed entities.

WrapTransaction ( System.Action action ) : void

Wraps code in a BeginTransaction and CommitTransaction

Méthodes protégées

Méthode Description
RockPostSave ( List updatedItems, PersonAlias personAlias, bool enableAuditing = false ) : void

Creates audit logs and/or triggers workflows for items that were changed

RockPreSave ( DbContext dbContext, PersonAlias personAlias, bool enableAuditing = false ) : List

Updates the Created/Modified data for any model being created or modified

Private Methods

Méthode Description
AuditClass ( Type baseType ) : bool
AuditProperty ( PropertyInfo propertyInfo ) : bool
GetAuditDetails ( DbContext dbContext, ContextItem item, int personAliasId ) : void
IsQualifierMatch ( ContextItem item, PropertyInfo>.Dictionary properties, WorkflowTrigger trigger ) : bool

Determines whether the entity matches the current and/or previous qualifier values. If

TriggerWorkflows ( ContextItem item, WorkflowTriggerType triggerType, PersonAlias personAlias ) : bool

Triggers all the workflows of the given triggerType for the given entity item.

Method Details

DbContext() public méthode

Initializes a new instance of the DbContext class.
public DbContext ( ) : System
Résultat System

DbContext() public méthode

Initializes a new instance of the DbContext class.
public DbContext ( string nameOrConnectionString ) : System
nameOrConnectionString string Either the database name or a connection string.
Résultat System

RockPostSave() protected méthode

Creates audit logs and/or triggers workflows for items that were changed
protected RockPostSave ( List updatedItems, PersonAlias personAlias, bool enableAuditing = false ) : void
updatedItems List The updated items.
personAlias PersonAlias The person alias.
enableAuditing bool if set to true [enable auditing].
Résultat void

RockPreSave() protected méthode

Updates the Created/Modified data for any model being created or modified
protected RockPreSave ( DbContext dbContext, PersonAlias personAlias, bool enableAuditing = false ) : List
dbContext DbContext The database context.
personAlias PersonAlias The person alias.
enableAuditing bool if set to true [enable auditing].
Résultat List

SaveChanges() public méthode

Saves all changes made in this context to the underlying database.
public SaveChanges ( ) : int
Résultat int

SaveChanges() public méthode

Saves all changes made in this context to the underlying database. The default pre and post processing can also optionally be disabled. This would disable audit records being created, workflows being triggered, and any PreSaveChanges() methods being called for changed entities.
public SaveChanges ( bool disablePrePostProcessing ) : int
disablePrePostProcessing bool if set to true disables /// the Pre and Post processing from being run. This should only be disabled /// when updating a large number of records at a time (e.g. importing records).
Résultat int

WrapTransaction() public méthode

Wraps code in a BeginTransaction and CommitTransaction
public WrapTransaction ( System.Action action ) : void
action System.Action The action.
Résultat void