IdeaBlade.Linq Assembly > IdeaBlade.Linq Namespace > ProjectionSelector Class > ProjectionSelector Constructor : ProjectionSelector Constructor(Type,String,IProjectionSelector,String) |
'Declaration
Public Function New( _ ByVal instanceType As Type, _ ByVal methodName As String, _ ByVal projection As IProjectionSelector, _ Optional ByVal alias As String _ )
'Usage
Dim instanceType As Type Dim methodName As String Dim projection As IProjectionSelector Dim alias As String Dim instance As New ProjectionSelector(instanceType, methodName, projection, alias)
public ProjectionSelector( Type instanceType, string methodName, IProjectionSelector projection, string alias )
public void DynamicGroupAndSum() { var q1 = EntityQuery.Create(typeof(Order), manager) .GroupBy(new ProjectionSelector("ShipCity")); Type groupType = q1.ElementType; var q2 = q1.Select( new ProjectionSelector(groupType, "Key", "ShipCity").Combine( new ProjectionSelector(groupType, "Select", new ProjectionSelector("Freight")).Dot("Sum()").WithAlias("Sum") )); var list = q2.Execute(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2