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


Specifies custom logic for traversing an association.
Signals that an entity should be cached.
A record containing change information for a single field of a single entity.
Contains information about the ChangeTracked event.
Tracks changes made to a single entity.
Signals that an a field should use a custom column mapping. See also INamingStrategy for performing database wide naming schemes.
Represents a strategy for managing physical database connections.
Signals that a class or EntityCollection<(Of <(TEntity>)>) field should use stored procedures for CRUD operations, instead of accessing a table directly.
Contains information about a database operation being notified to a ConnectionStrategy.
The default database naming strategy.
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.
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.
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.
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
Event data relating to the EntityStateChanged event.
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.
Specifies the name of the field or fields which contains the foreign key value for a to-one association.
Signal to LightSpeed that the target field should be included when indexing a model with a full text search engine.
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.
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.
Represents a general error that occurs within the LightSpeed framework.
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.
Represents an optimistic concurrency violation which occurs when an update or delete fails due to stale data.
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.
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.
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.
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.


// type Contribution

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

// type Member

private readonly EntityCollection<Contribution> _contributions
  = new EntityCollection<Contribution>();

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.
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.
Notifies the framework that a field should not be considered by the framework.
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.
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.
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.
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.
Overrides the default mapping of value object fields to database column names, for a specific occurrence of the value object type only.


Implements custom logic for traversing an association. See AssociationResolverAttribute.
Defines a strategy for resolving display names.
Creates entity instances.
Provides custom conversion between a database column and the CLR type of an entity field.
Defines a strategy for resolving database names.
Contract for a repository class.
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.
A factory for concrete IUnitOfWork implementations.


Describes the behavior to be used when calling UnitOfWork.Attach()
Specifies how to generate times for automatic timestamp properties such as CreatedOn (track create time), UpdatedOn (track update time) and DeletedOn (soft delete).
The kind of changes that can be tracked in a ChangeTrackedEventArgs.
The mode to be used when tracking field changes to entities.
Specifies the kind of database operation being notified to a ConnectionStrategy.
The data providers supported by LightSpeed. Unless otherwise specified, the version number indicates the minimum supported database version.
Represents the current state of an Entity.
Determines the strategy used to generate new identity values.
Specifies the kind of mapping from entity classes to database tables in an inheritance hierarchy.
Provides options for enabling or disabling potentially breaking changes.
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