Performs a Find operation where the output is to be a projection across one or
more types in the query rather than an entity result and the resulting projection
is to be mapped to a specified type.
Namespace:
Mindscape.LightSpeed.ServiceModelAssembly: Mindscape.LightSpeed.ServiceModel (in Mindscape.LightSpeed.ServiceModel.dll)
Version: 4.0.0.0 (4.0.0.0)
Syntax
C# |
---|
[UseNetDataContractSerializerAttribute] [OperationContractAttribute] Object[] ProjectToType( string typename, Query query ) |
Visual Basic (Declaration) |
---|
<UseNetDataContractSerializerAttribute> _ <OperationContractAttribute> _ Function ProjectToType ( _ typename As String, _ query As Query _ ) As Object() |
Parameters
- typename
- Type: System..::.String
The fully qualified type which to project the results into.
- query
- Type: Mindscape.LightSpeed.Querying..::.Query
The query to be executed which must contain the entity type.
Return Value
An array of objects of the requested type where the data will be mapped in a 1:1 fashion from the result set against the properties of the type.Remarks
This operation is typically called when executing a query where the output is to be
an known but non entity shape given the entities involved in the query.
e.g. select a.Name, b.Description from EntityA a inner join EntityB b on a.SomeProperty = b.SomeProperty
where we have a known type such as:
public class ABDescriptor
{
public string Name { get; set; }
public string Description { get; set; }
}