共用方式為


StructuralTypeConfiguration<TStructuralType>.Property<T> 方法 (Expression<Func<TStructuralType, T>>)

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

設定在此類型上定義的 struct 屬性。

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

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")> _
Public Function Property(Of T As {Structure, New}) ( _
    propertyExpression As Expression(Of Func(Of TStructuralType, T)) _
) As PrimitivePropertyConfiguration
'用途
Dim instance As StructuralTypeConfiguration 
Dim propertyExpression As Expression(Of Func(Of TStructuralType, T))
Dim returnValue As PrimitivePropertyConfiguration 

returnValue = instance.Property(propertyExpression)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public PrimitivePropertyConfiguration Property<T>(
    Expression<Func<TStructuralType, T>> propertyExpression
)
where T : struct, new()
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1011:ConsiderPassingBaseTypesAsParameters")]
public:
generic<typename T>
where T : value class, gcnew()
PrimitivePropertyConfiguration^ Property(
    Expression<Func<TStructuralType, T>^>^ propertyExpression
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")>]
member Property : 
        propertyExpression:Expression<Func<'TStructuralType, 'T>> -> PrimitivePropertyConfiguration   when 'T : struct, new()
JScript does not support generic types and methods.

類型參數

  • T
    正在設定之屬性的類型。

參數

傳回值

類型:System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration
可用來設定此屬性的組態物件。

請參閱

參考

StructuralTypeConfiguration<TStructuralType> 類別

Property 多載

System.Data.Entity.ModelConfiguration.Configuration 命名空間