Returns an IDataReader containing the results of the specified projection query. A projection query returns only a subset of fields of an entity. At lease one field name must have been added to the Projection collection.

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

Syntax

C#
IDataReader Project(
	Query query
)
Visual Basic (Declaration)
Function Project ( _
	query As Query _
) As IDataReader

Parameters

query
Type: Mindscape.LightSpeed.Querying..::.Query
The query.

Return Value

An IDataReader containing the results of the specified projection query.

Examples

CopyC#
Query query = new Query(typeof(Product), Entity.Attribute("OrderId") == 101);
query.Projection.Add("Name");
query.Projection.Add("Price");

using (IDataReader reader = unitOfWork.Project(query))
{
  while (reader.Read())
  {
    yield return new { Name = reader.GetString(0), Price = reader.GetDecimal(1) };
  }
}

See Also