C# Class Rock.Data.LinqRuntimeTypeBuilder

Helps create a Type at runtime that can be used when building a dynamic Linq select statement From http://stackoverflow.com/questions/606104/how-to-create-linq-expression-tree-with-anonymous-type-in-it see answer http://stackoverflow.com/a/723018/1755417 The stackoverflow version only defined fields, but our implementation adds Properties
Mostra file Open project: NewSpring/Rock

Public Methods

Method Description
GetDynamicType ( Type>.Dictionary fields ) : Type

Creates a Type from a list of fields and their type then returns that Type

GetDynamicType ( IEnumerable fields ) : Type

Creates a Type from a list of field PropertyInfos then returns that type

Private Methods

Method Description
GetTypeKey ( Type>.Dictionary fields ) : string

Gets the type key which can be used to look in our cache of builtTypes

GetTypeKey ( IEnumerable fields ) : string

Gets the type key which can be used to look in our cache of builtTypes

LinqRuntimeTypeBuilder ( ) : System

Initializes the LinqRuntimeTypeBuilder class.

Method Details

GetDynamicType() public static method

Creates a Type from a list of fields and their type then returns that Type
fields fields;fields must have at least 1 field definition
public static GetDynamicType ( Type>.Dictionary fields ) : Type
fields Type>.Dictionary The fields.
return System.Type

GetDynamicType() public static method

Creates a Type from a list of field PropertyInfos then returns that type
public static GetDynamicType ( IEnumerable fields ) : Type
fields IEnumerable The fields.
return System.Type