Click or drag to resize

DataScope Class

Abstract base class to create a custom data scope class.
Inheritance Hierarchy
SystemObject
  SD.LLBLGen.Pro.ORMSupportClassesDataScope

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.5.0.0 (5.5.18.1019)
Syntax
public abstract class DataScope : IDisposable

The DataScope type exposes the following members.

Constructors
  NameDescription
Protected methodDataScope
Initializes a new instance of the DataScope class.
Protected methodDataScope(DataScopeRefetchStrategyType)
Initializes a new instance of the DataScope class.
Top
Properties
  NameDescription
Public propertyRefetchStrategy
Gets or sets the refetch strategy for saved entities a datascope instance has to take after commit.
Top
Methods
  NameDescription
Protected methodAttach(IEntityCollectionCore)
Attaches the collection and all entities directly and indirectly reachable from this collection to the scope.
Protected methodAttach(IEntityCore)
Attaches the specified entity and all entities reachable from this entity to the scope.
Protected methodBuildWorkForCommit
Builds the work in a Unit of work object for commit. The unit of work created by this method is used in CommitChanges.
Public methodCommitChanges(ITransactionController)
Commits the changes tracked by this scope. Use this method to commit the changes using a transaction controller directly. It uses the passed in controller (Adapter: an IDataAccessAdapter instance will do, SelfServicing: an ITransaction instance will do) to commit the unit of work. If the controller has already a transaction in progress, that transaction is used to perform the work, otherwise a new transaction is started. To commit the work using external code, e.g. another tier or a service, please use the CommitChanges overload which accepts a Func instead.
Public methodCommitChanges(FuncIUnitOfWorkCore, Boolean)
Commits the changes tracked by this scope using the passed in commit func. Use this method to commit the changes using logic outside this scope, e.g. a service or another tier, to which the unit of work object passed into the commitUnitOfWork func is transported. To commit the changes directly using a transaction provider by a transaction controller (Adapter: a DataAccessAdapter, SelfServicing: a Transaction object), please use the CommitChanges overload which accepts a transaction controller.
Public methodCommitChangesAsync(ITransactionController)
Async variant of CommitChanges(ITransactionController) Commits the changes tracked by this scope. Use this method to commit the changes using a transaction controller directly. It uses the passed in controller (Adapter: an IDataAccessAdapter instance will do, SelfServicing: an ITransaction instance will do) to commit the unit of work. If the controller has already a transaction in progress, that transaction is used to perform the work, otherwise a new transaction is started. To commit the work using external code, e.g. another tier or a service, please use the CommitChanges overload which accepts a Func instead.
Public methodCommitChangesAsync(ITransactionController, CancellationToken)
Async variant of CommitChanges(ITransactionController) Commits the changes tracked by this scope. Use this method to commit the changes using a transaction controller directly. It uses the passed in controller (Adapter: an IDataAccessAdapter instance will do, SelfServicing: an ITransaction instance will do) to commit the unit of work. If the controller has already a transaction in progress, that transaction is used to perform the work, otherwise a new transaction is started. To commit the work using external code, e.g. another tier or a service, please use the CommitChanges overload which accepts a Func instead.
Protected methodDispose
Releases unmanaged and - optionally - managed resources
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFetchData
Fetches the data for the scope. It calls FetchDataImpl, which should be implemented in a derived class of this scope to actually fetch the data.
Public methodFetchDataAsync(Object)
Async variant of FetchData(Object) Fetches the data for the scope. It calls FetchDataImpl, which should be implemented in a derived class of this scope to actually fetch the data.
Public methodFetchDataAsync(CancellationToken, Object)
Async variant of FetchData(Object) Fetches the data for the scope. It calls FetchDataImpl, which should be implemented in a derived class of this scope to actually fetch the data.
Protected methodFetchDataAsyncImpl
Async variant of FetchDataImpl(Object) The implementation of the fetch method. In this method, fetch the data for the scope. Use the TrackQuery methods to make sure all entities fetched in this method are tracked by the scope.
Protected methodFetchDataImpl
The implementation of the fetch method. In this method, fetch the data for the scope. Use the TrackQuery methods to make sure all entities fetched in this method are tracked by the scope.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMarkForDeletion(IEntityCollectionCore)
Marks all entities in the collection specified to be deleted. It adds all entities in toDelete and all entities directly and indirectly reachable from this collection to the scope and will delete all entities in toDelete when CommitChanges is called.
Protected methodMarkForDeletion(IEntityCore)
Marks the entity specified to be deleted. It adds the entity specified and all entities reachable from this entity to the scope and will delete the entity specified when CommitChanges is called.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnAfterCommitChanges
Called after this scope has commit the changes on the unit of work
Protected methodOnAfterFetchData
Called after the scope has successfully called FetchDataImpl.
Protected methodOnBeforeCommitChanges
Called before this scope will build the unit of work to commit the changes with.
Protected methodOnBeforeFetchData
Called before the scope calls FetchDataImpl.
Protected methodOnEntityDelete
Called when toDelete is about to be deleted. Use this method to specify work to be done by the scope to avoid FK constraint issues. workData is meant to collect this work. It can either be additional entities to delete prior to 'toDelete', or a list of relations which are used to create cascading delete actions executed prior to the delete action of toDelete.
Protected methodOnReset
Called when this scope is reset.
Protected methodOverrideDefaultNavigatorAspects
Overrides the default navigator aspects defined by this scope.
Public methodReset
Resets this instance.
Protected methodSetNavigatorAspectsTEntity
Sets the navigator aspects for the navigator on the type TEntity.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodTrackQueryTQuery
Tracks the QuerySpec or Linq query and will add all entities fetched with this query to this scope.
Top
Events
  NameDescription
Public eventContainedDataChanged
Raised when the data of an entity in the scope changed. Ignored during fetches. Sender is the entity which data was changed
Public eventEntityAdded
Raised when an entity has been added to the scope. Ignored during fetches. Sender is the entity which was added.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIDisposableDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Top
See Also