Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CompiledQuery Class

CompiledQuery Class

Represents a cached LINQ to Entities query.

System.Object
  System.Data.Objects.CompiledQuery

Namespace:  System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

[<Sealed>]
type CompiledQuery =  class end

The CompiledQuery type exposes the following members.

  NameDescription
Public methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(TArg0, TResult)(Expression(Func(TArg0, TResult)))Creates a new delegate that represents the compiled LINQ to Entities query.
Public methodStatic memberCompile(TArg0, TArg1, TResult)(Expression(Func(TArg0, TArg1, TResult)))Creates a new delegate that represents the compiled LINQ to Entities query.
Public methodStatic memberCompile(TArg0, TArg1, TArg2, TResult)(Expression(Func(TArg0, TArg1, TArg2, TResult)))Creates a new delegate that represents the compiled LINQ to Entities query.
Public methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodStatic memberCompile(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 methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Provides for compilation and caching of queries for reuse. Conceptually this class contains a single Compile method with several overloads. You call the Compile method to create a new delegate to represent the compiled query. The delegate, when invoked with the ObjectContext input parameter and other parameter values, produces some result (such as an IQueryable(T) instance). The query is translated and cached when the delegate is invoked for the first time.

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:

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft