Breyta

Deila með


CompiledQuery.Compile Method

Definition

Overloads

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TArg14,TArg15,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TArg14,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TResult>(Expression<Func<TArg0,TArg1, TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11, TArg12,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TResult>(Expression<Func<TArg0,TArg1,TArg2, TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3, TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4, TArg5,TArg6,TArg7,TArg8,TArg9,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5, TArg6,TArg7,TArg8,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TResult>(Expression<Func<TArg0,TArg1,TArg2,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TResult>(Expression<Func<TArg0,TArg1,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TResult>(Expression<Func<TArg0,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TArg14,TArg15,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TArg11, typename TArg12, typename TArg13, typename TArg14, typename TArg15, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'TArg14, 'TArg15, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'TArg14, 'TArg15, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TArg11 As ObjectContext, TArg12 As ObjectContext, TArg13 As ObjectContext, TArg14 As ObjectContext, TArg15 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

TArg11

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg11 must be a primitive type.

TArg12

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg12 must be a primitive type.

TArg13

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg13 must be a primitive type.

TArg14

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg14 must be a primitive type.

TArg15

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg15 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TArg15,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TArg14,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TArg11, typename TArg12, typename TArg13, typename TArg14, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'TArg14, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'TArg14, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TArg11 As ObjectContext, TArg12 As ObjectContext, TArg13 As ObjectContext, TArg14 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

TArg11

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg11 must be a primitive type.

TArg12

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg12 must be a primitive type.

TArg13

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg13 must be a primitive type.

TArg14

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg14 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TArg14,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TArg13,TResult>(Expression<Func<TArg0, TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10, TArg11,TArg12,TArg13,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TArg11, typename TArg12, typename TArg13, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'TArg13, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TArg11 As ObjectContext, TArg12 As ObjectContext, TArg13 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

TArg11

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg11 must be a primitive type.

TArg12

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg12 must be a primitive type.

TArg13

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg13 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TArg13,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TArg12,TResult>(Expression<Func<TArg0,TArg1, TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11, TArg12,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TArg11, typename TArg12, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'TArg12, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TArg11 As ObjectContext, TArg12 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

TArg11

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg11 must be a primitive type.

TArg12

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg12 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TArg12,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TArg11,TResult>(Expression<Func<TArg0,TArg1,TArg2, TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TArg11, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'TArg11, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TArg11 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

TArg11

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg11 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TArg11,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TArg10,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3, TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TArg10, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'TArg10, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TArg10 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

TArg10

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg10 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TArg10,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TArg9,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4, TArg5,TArg6,TArg7,TArg8,TArg9,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TArg9, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'TArg9, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TArg9 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

TArg9

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg9 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TArg9,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8, TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5, TArg6,TArg7,TArg8,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TArg8, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'TArg8, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TArg8 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TArg8

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg8 must be a primitive type.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TArg8,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TArg7, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'TArg7, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TArg7 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TArg7

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg7 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TArg7,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,T8,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TArg6, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TArg6, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TArg6 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TArg6

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg6 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TArg6,TResult>

Func<T1,T2,T3,T4,T5,T6,T7,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TArg5 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TArg5

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg5 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult>

Func<T1,T2,T3,T4,T5,T6,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TArg4 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TArg4

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg4 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TArg4,TResult>

Func<T1,T2,T3,T4,T5,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TArg3,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TArg3, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TArg3, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TArg3,TResult> Compile<TArg0,TArg1,TArg2,TArg3,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TArg3,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TArg3 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TResult))) As Func(Of TArg0, TArg1, TArg2, TArg3, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TArg3

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg3 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TArg3,TResult>(Expression<Func<TArg0,TArg1,TArg2,TArg3,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TArg3,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TArg3,TResult>

Func<T1,T2,T3,T4,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TArg2,TResult>(Expression<Func<TArg0,TArg1,TArg2,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TArg2, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TArg2, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TArg2, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TArg2,TResult> Compile<TArg0,TArg1,TArg2,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TArg2,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'TArg2, 'Result>> -> Func<'TArg0, 'TArg1, 'TArg2, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TArg2 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TArg2, TResult))) As Func(Of TArg0, TArg1, TArg2, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TArg2

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg2 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TArg2,TResult>(Expression<Func<TArg0,TArg1,TArg2,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TArg2,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TArg2,TResult>

Func<T1,T2,T3,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Examples

The following example compiles and then invokes a query that accepts DateTime and Decimal input parameters and returns a sequence of orders where the order date is later than March 8, 2003 and the total due is less than $300.00:

static readonly Func<AdventureWorksEntities, DateTime, Decimal, IQueryable<SalesOrderHeader>> s_compiledQuery5 =
    CompiledQuery.Compile<AdventureWorksEntities, DateTime, Decimal, IQueryable<SalesOrderHeader>>(
            (ctx, orderDate, totalDue) => from product in ctx.SalesOrderHeaders
                                          where product.OrderDate > orderDate
                                             && product.TotalDue < totalDue
                                          orderby product.OrderDate
                                          select product);

static void CompiledQuery5()
{
    using (AdventureWorksEntities context = new AdventureWorksEntities())
    {
        DateTime date = new DateTime(2003, 3, 8);
        Decimal amountDue = 300.00M;

        IQueryable<SalesOrderHeader> orders = s_compiledQuery5.Invoke(context, date, amountDue);

        foreach (SalesOrderHeader order in orders)
        {
            Console.WriteLine("ID: {0} Order date: {1} Total due: {2}", order.SalesOrderID, order.OrderDate, order.TotalDue);
        }
    }
}
ReadOnly s_compQuery5 = _
   CompiledQuery.Compile(Of AdventureWorksEntities, DateTime, Decimal, IQueryable(Of SalesOrderHeader))( _
                Function(ctx, orderDate, totalDue) From product In ctx.SalesOrderHeaders _
                                                   Where product.OrderDate > orderDate _
                                                      And product.TotalDue < totalDue _
                                                   Order By product.OrderDate _
                                                   Select product)
Sub CompiledQuery5()

    Using context As New AdventureWorksEntities()

        Dim orderedAfterDate As DateTime = New DateTime(2003, 3, 8)
        Dim amountDue As Decimal = 300.0

        Dim orders As IQueryable(Of SalesOrderHeader) = _
            s_compQuery5.Invoke(context, orderedAfterDate, amountDue)

        For Each order In orders
            Console.WriteLine("ID: {0} Order date: {1} Total due: {2}", _
                              order.SalesOrderID, order.OrderDate, order.TotalDue)
        Next

    End Using
End Sub

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TArg1,TResult>(Expression<Func<TArg0,TArg1,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TArg1, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TArg1, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TArg1, TResult> ^> ^ query);
public static Func<TArg0,TArg1,TResult> Compile<TArg0,TArg1,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TArg1,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'TArg1, 'Result>> -> Func<'TArg0, 'TArg1, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TArg1, TResult))) As Func(Of TArg0, TArg1, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TArg1

Represents the type of the parameter that has to be passed in when executing the delegate returned by this method. TArg1 must be a primitive type.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TArg1,TResult>(Expression<Func<TArg0,TArg1,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TArg1,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TArg1,TResult>

Func<T1,T2,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Examples

The following example compiles and then invokes a query that accepts a Decimal input parameter and returns a sequence of orders where the total due is greater than or equal to $200.00:

static readonly Func<AdventureWorksEntities, Decimal, IQueryable<SalesOrderHeader>> s_compiledQuery2 =
    CompiledQuery.Compile<AdventureWorksEntities, Decimal, IQueryable<SalesOrderHeader>>(
            (ctx, total) => from order in ctx.SalesOrderHeaders
                            where order.TotalDue >= total
                            select order);

static void CompiledQuery2()
{
    using (AdventureWorksEntities context = new AdventureWorksEntities())
    {
        Decimal totalDue = 200.00M;

        IQueryable<SalesOrderHeader> orders = s_compiledQuery2.Invoke(context, totalDue);

        foreach (SalesOrderHeader order in orders)
        {
            Console.WriteLine("ID: {0}  Order date: {1} Total due: {2}",
                order.SalesOrderID,
                order.OrderDate,
                order.TotalDue);
        }
    }
}
ReadOnly s_compQuery2 As Func(Of AdventureWorksEntities, Decimal, IQueryable(Of SalesOrderHeader)) = _
    CompiledQuery.Compile(Of AdventureWorksEntities, Decimal, IQueryable(Of SalesOrderHeader))( _
                Function(ctx As AdventureWorksEntities, total As Decimal) _
                    From order In ctx.SalesOrderHeaders _
                    Where (order.TotalDue >= total) _
                    Select order)

Sub CompiledQuery2()
    Using context As New AdventureWorksEntities()

        Dim totalDue As Decimal = 200.0

        Dim orders As IQueryable(Of SalesOrderHeader) = s_compQuery2.Invoke(context, totalDue)

        For Each order In orders
            Console.WriteLine("ID: {0}  Order date: {1} Total due: {2}", _
                                    order.SalesOrderID, _
                                    order.OrderDate, _
                                    order.TotalDue)
        Next
    End Using
End Sub

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to

Compile<TArg0,TResult>(Expression<Func<TArg0,TResult>>)

Creates a new delegate that represents the compiled LINQ to Entities query.

public:
generic <typename TArg0, typename TResult>
 where TArg0 : System::Data::Objects::ObjectContext static Func<TArg0, TResult> ^ Compile(System::Linq::Expressions::Expression<Func<TArg0, TResult> ^> ^ query);
public static Func<TArg0,TResult> Compile<TArg0,TResult> (System.Linq.Expressions.Expression<Func<TArg0,TResult>> query) where TArg0 : System.Data.Objects.ObjectContext;
static member Compile : System.Linq.Expressions.Expression<Func<'TArg0, 'Result>> -> Func<'TArg0, 'Result (requires 'TArg0 :> System.Data.Objects.ObjectContext)> (requires 'TArg0 :> System.Data.Objects.ObjectContext)
Public Shared Function Compile(Of TArg0 As ObjectContext, TResult As ObjectContext) (query As Expression(Of Func(Of TArg0, TResult))) As Func(Of TArg0, TResult)

Type Parameters

TArg0

A type derived from ObjectContext.

TResult

The type of the query results returned by executing the delegate returned by the Compile<TArg0,TResult>(Expression<Func<TArg0,TResult>>) method.

Parameters

query
Expression<Func<TArg0,TResult>>

The lambda expression to compile.

Returns

Func<TArg0,TResult>

Func<T,TResult>, a generic delegate that represents the compiled LINQ to Entities query.

Examples

The following example compiles and then invokes a query that returns an ObjectQuery<T> instance:

static readonly Func<AdventureWorksEntities, ObjectQuery<SalesOrderHeader>> s_compiledQuery1 =
    CompiledQuery.Compile<AdventureWorksEntities, ObjectQuery<SalesOrderHeader>>(
            ctx => ctx.SalesOrderHeaders);

static void CompiledQuery1_MQ()
{

    using (AdventureWorksEntities context = new AdventureWorksEntities())
    {
        IQueryable<SalesOrderHeader> orders = s_compiledQuery1.Invoke(context);

        foreach (SalesOrderHeader order in orders)
            Console.WriteLine(order.SalesOrderID);
    }
}
ReadOnly s_compQuery1 As Func(Of AdventureWorksEntities, ObjectQuery(Of SalesOrderHeader)) = _
    CompiledQuery.Compile(Of AdventureWorksEntities, ObjectQuery(Of SalesOrderHeader))( _
                Function(ctx) ctx.SalesOrderHeaders)

Sub CompiledQuery1_MQ()

    Using context As New AdventureWorksEntities()

        Dim orders As ObjectQuery(Of SalesOrderHeader) = s_compQuery1.Invoke(context)

        For Each order In orders
            Console.WriteLine(order.SalesOrderID)
        Next

    End Using
End Sub

Remarks

For more information and examples, see Compiled Queries (LINQ to Entities).

Applies to