The Mindscape.LightSpeed namespace provides classes that are used to implement the core services of the framework.

Classes

  ClassDescription
AssociationResolverAttribute
Specifies custom logic for traversing an association.
CachedAttribute
Signals that an entity should be cached.
ChangedValue
A record containing change information for a single field of a single entity.
ChangeTrackedEventArgs
Contains information about the ChangeTracked event.
ChangeTracker
Tracks changes made to a single entity.
ColumnAttribute
Signals that an a field should use a custom column mapping. See also INamingStrategy for performing database wide naming schemes.
ConnectionStrategy
Represents a strategy for managing physical database connections.
CrudProcedureAttribute
Signals that a class or EntityCollection<(Of <(TEntity>)>) field should use stored procedures for CRUD operations, instead of accessing a table directly.
DatabaseOperation
Contains information about a database operation being notified to a ConnectionStrategy.
DefaultNamingStrategy
The default database naming strategy.
DependentAttribute
Notifies the framework that a one-to-many association should be considered dependent. This determines, among other things, delete cascade behaviour. When a one-to-many association is dependent, child rows are cascade deleted along with the parent entity. DependentAttribute should be applied to the foreign key field (not the association field). NB. This is normally inferred based on the nullability of the corresponding foreign key field.
DiscriminatorAttribute
Facilitates Single Table Inheritance. Use the Attribute property to indicate the database column used to discriminate between types in an inheritance hierachy. The database column used as a discriminator is not required to exist in the domain model.
EagerLoadAttribute
Notifies the framework that a field should be eager loaded. If this attribute is applied to a value object field, then AggregateName should be specified and the field becomes lazy by default.
Entity
The non-generic entity abstract base class. Never derive directly from this class but from Entity<(Of <(TId>)>).
Entity<(Of <(TId>)>)
The abstract base class inherited by all entities.
EntityCollection<(Of <(TEntity>)>)
A collection of Entity objects.
EntityEventArgs<(Of <(TEntity>)>)
Data about an event relating to a single Entity.
EntityHolder<(Of <(TEntity>)>)
An object that holds a reference to an associated Entity
EntityStateChangedEventArgs
Event data relating to the EntityStateChanged event.
EntityTuple
Represents a collection of tuples (pair, triple, etc.) of entities.
EntityTuple<(Of <(T>)>)
An EntityTuple containing a single collection of entities.
EntityTuple<(Of <(T1, T2>)>)
An EntityTuple containing two collections of entities.
EntityTuple<(Of <(T1, T2, T3>)>)
An EntityTuple containing three collections of entities.
ForeignKeyFieldAttribute
Specifies the name of the field or fields which contains the foreign key value for a to-one association.
IndexedAttribute
Signal to LightSpeed that the target field should be included when indexing a model with a full text search engine.
InheritanceMappingAttribute
Specifies how an inheritance hierarchy is mapped to tables in the database. This attribute should be applied only to the root class of an inheritance hierarchy.
LightSpeedContext
The top-level object in the framework. Sets up a context within which the framework operates.
LightSpeedContext<(Of <(TUnitOfWork>)>)
Represents a LightSpeed domain model with a strong-typed IUnitOfWork implementation.
LightSpeedException
Represents a general error that occurs within the LightSpeed framework.
NoReverseAssociationAttribute
Specifies that an association has no reverse association. This attribute may be applied only to to-one associations where a foreign key field is also present.
OptimisticConcurrencyException
Represents an optimistic concurrency violation which occurs when an update or delete fails due to stale data.
OrderByAttribute
Determines the default ORDER BY clause applied when querying. This attribute can be applied to either an Entity<(Of <(TId>)>) class or an EntityCollection<(Of <(TEntity>)>) one-to-many association field. When defined at the class level the specified ordering becomes the default ordering used when retrieving the associated class. When defined at the association level the specified ordering is applied only when loading that particular association.
PerRequestUnitOfWorkScope<(Of <(TUnitOfWork>)>)
A UnitOfWorkScopeBase<(Of <(TUnitOfWork>)>) appropriate for web applications. Creates a single unit of work instance per TUnitOfWork per web request.
PerThreadUnitOfWorkScope<(Of <(TUnitOfWork>)>)
A UnitOfWorkScopeBase<(Of <(TUnitOfWork>)>) that maintains one unit of work per thread.
QueryPropertyAttribute
When applied to a field, maps a property name to that field so that the property name can be used in Entity.Attribute expressions or LINQ queries instead of the private field name.
RemovalBehaviorAttribute
Notifies the framework which action to apply to child relationships when deleting an entity through a UnitOfWork.Remove() or cascaded delete. This attribute is currently only supported on EntityHolder declarations and is to be applied on the child side of the relationship.
RepositoryBase<(Of <(TUnitOfWork>)>)
Base class for classes implementing a Repository pattern.
ReverseAssociationAttribute
When more than one association of the same type exists on a model use this attribute to specify the name of the reverse association field on the target type. The attribute only needs to be applied to one end of the association (either one) not both. N.B. This is only required when there is more than one association between two models. i.e. One table has more than one foreign key to another table.

Examples

CopyC#
// type Contribution

private readonly EntityHolder<Member> _approvedBy = new EntityHolder<Member>();
private readonly EntityHolder<Member> _contributor = new EntityHolder<Member>();

// type Member

[ReverseAssociation("Contributor")]
private readonly EntityCollection<Contribution> _contributions
  = new EntityCollection<Contribution>();

[ReverseAssociation("ApprovedBy")]
private readonly EntityCollection<Contribution> _approvedContributions
  = new EntityCollection<Contribution>();
SimpleUnitOfWorkScope<(Of <(TUnitOfWork>)>)
A non-threadsafe UnitOfWorkScopeBase<(Of <(TUnitOfWork>)>) that holds the current unit of work in an instance variable.
TableAttribute
Signals that a class should use a custom table mapping. See also INamingStrategy for performing database wide naming schemes.
ThroughAssociation<(Of <(TThrough, TTarget>)>)
An EntityCollection{TEntity} decorator that provides convenient access to entities that are normally accessed through an intermediary association. The primary use of this class is to provide a more object-oriented view of many-to-many relationships.
TransientAttribute
Notifies the framework that a field should not be considered by the framework.
UnitOfWork
Defines the contract for a Unit of Work. A Unit of Work maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
UnitOfWorkBase
Provides common implementation for overloads of IUnitOfWork methods.
UnitOfWorkScopeBase<(Of <(TUnitOfWork>)>)
Abstract base class for unit of work "scope". A scope manages unit of work lifetime according to a particular scoping strategy.
ValueFieldAttribute
Identifies a field as a persistent value. This attribute is required only when LightSpeed is unable to infer that the field is persistent, e.g. database-specific reference types.
ValueObjectAttribute
Marks a field as Value Object. A value object is immutable, has no identity and is mapped as part of its owning Entity . Example Value Objects are Money or Address.
ValueObjectColumnAttribute
Overrides the default mapping of value object fields to database column names, for a specific occurrence of the value object type only.

Interfaces

  InterfaceDescription
IAssociationResolver
Implements custom logic for traversing an association. See AssociationResolverAttribute.
IDisplayNamingStrategy
Defines a strategy for resolving display names.
IEntityFactory
Creates entity instances.
IFieldConverter
Provides custom conversion between a database column and the CLR type of an entity field.
INamingStrategy
Defines a strategy for resolving database names.
IRepository
Contract for a repository class.
IUnitOfWork
Defines the contract for a Unit of Work. A Unit of Work maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
IUnitOfWorkFactory
A factory for concrete IUnitOfWork implementations.

Enumerations

  EnumerationDescription
AttachMode
Describes the behavior to be used when calling UnitOfWork.Attach()
AutoTimestampMode
Specifies how to generate times for automatic timestamp properties such as CreatedOn (track create time), UpdatedOn (track update time) and DeletedOn (soft delete).
ChangeKind
The kind of changes that can be tracked in a ChangeTrackedEventArgs.
ChangeTrackingMode
The mode to be used when tracking field changes to entities.
DatabaseOperationKind
Specifies the kind of database operation being notified to a ConnectionStrategy.
DataProvider
The data providers supported by LightSpeed. Unless otherwise specified, the version number indicates the minimum supported database version.
EntityState
Represents the current state of an Entity.
IdentityMethod
Determines the strategy used to generate new identity values.
InheritanceMappingKind
Specifies the kind of mapping from entity classes to database tables in an inheritance hierarchy.
LightSpeedCompatibilityOptions
Provides options for enabling or disabling potentially breaking changes.
RemovalBehaviorAction
Indicates which action should be applied to any child relationships when the deletion of a parent entity occurs The two options are to set the relationship as null which is the default behavior, or to take no action which will throw an exception when a parent is removed which would leave a child orphaned