Performs a query with a projection, and materialises the results as the specified type.

Namespace:  Mindscape.LightSpeed
Assembly:  Mindscape.LightSpeed (in Mindscape.LightSpeed.dll)
Version: 4.0.0.0 (4.0.0.0)

Syntax

C#
IList Project(
	Query query,
	Type projectedType
)
Visual Basic (Declaration)
Function Project ( _
	query As Query, _
	projectedType As Type _
) As IList

Parameters

query
Type: Mindscape.LightSpeed.Querying..::.Query
The query to be performed.
projectedType
Type: System..::.Type
The type of object to be materialised from the query results.

Return Value

A list of objects of the specified type.

Remarks

The results of the projection are not entities, and are not associated with the unit of work.

Examples

CopyC#
Query query = new Query(typeof(Product));
query.Projection.Add("Name");
query.Projection.Add("Price");

// PricingInfo is a non-entity class with Name and Price properties
IList pricingInfo = unitOfWork.Project(query, typeof(PricingInfo));

See Also