共用方式為


CompiledQuery.Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> 方法 (Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>>)

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

建立新委派以表示編譯的 LINQ to Entities 查詢。

命名空間:  System.Data.Entity.Core.Objects
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification := "required for this feature")> _
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
Public Shared Function Compile(Of TArg0 As ObjectContext, TArg1, TArg2, TArg3, TArg4, TArg5, TResult) ( _
    query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult)) _
) As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult)
'用途
Dim query As Expression(Of Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult))
Dim returnValue As Func(Of TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult)

returnValue = CompiledQuery.Compile(query)
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "required for this feature")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(
    Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>> query
)
where TArg0 : ObjectContext
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1011:ConsiderPassingBaseTypesAsParameters", Justification = L"required for this feature")]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
public:
generic<typename TArg0, typename TArg1, typename TArg2, typename TArg3, typename TArg4, typename TArg5, typename TResult>
where TArg0 : ObjectContext 
static Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>^ Compile(
    Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>^>^ query
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "required for this feature")>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
static member Compile : 
        query:Expression<Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TResult>> -> Func<'TArg0, 'TArg1, 'TArg2, 'TArg3, 'TArg4, 'TArg5, 'TResult>  when 'TArg0 : ObjectContext
JScript does not support generic types and methods.

類型參數

  • TArg1
    表示在執行由此方法所傳回的委派時,所必須傳入的參數類型。 TArg1 必須為基本類型。
  • TArg2
    表示在執行由此方法所傳回的委派時,所必須傳入的參數類型。 TArg2 必須為基本類型。
  • TArg3
    表示在執行由此方法所傳回的委派時,所必須傳入的參數類型。 TArg3 必須為基本類型。
  • TArg4
    表示在執行由此方法所傳回的委派時,所必須傳入的參數類型。 TArg4 必須為基本類型。
  • TArg5
    表示在執行由此方法所傳回的委派時,所必須傳入的參數類型。 TArg5 必須為基本類型。
  • TResult
    查詢結果的類型 T,這些查詢結果是由執行 Compile<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Expression<Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>>) 方法所傳回的委派而傳回。

參數

傳回值

類型:System.Func<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>
Func<T1, T2, T3, T4, T5, T6, TResult> ,表示編譯的 LINQ to Entities 查詢的泛型委派。

請參閱

參考

CompiledQuery 類別

Compile 多載

System.Data.Entity.Core.Objects 命名空間