DbEntityEntry<TEntity>.Property<TProperty> 方法 (Expression<Func<TEntity, TProperty>>)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
取得物件,表示此實體的純量或複雜屬性。
命名空間: System.Data.Entity.Infrastructure
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
<SuppressMessageAttribute("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId := "0#", _
Justification := "Rule predates more fluent naming conventions.")> _
Public Function Property(Of TProperty) ( _
property As Expression(Of Func(Of TEntity, TProperty)) _
) As DbPropertyEntry(Of TEntity, TProperty)
'用途
Dim instance As DbEntityEntry
Dim property As Expression(Of Func(Of TEntity, TProperty))
Dim returnValue As DbPropertyEntry(Of TEntity, TProperty)
returnValue = instance.Property(property)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#",
Justification = "Rule predates more fluent naming conventions.")]
public DbPropertyEntry<TEntity, TProperty> Property<TProperty>(
Expression<Func<TEntity, TProperty>> property
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = L"0#",
Justification = L"Rule predates more fluent naming conventions.")]
public:
generic<typename TProperty>
DbPropertyEntry<TEntity, TProperty>^ Property(
Expression<Func<TEntity, TProperty>^>^ property
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
[<SuppressMessageAttribute("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#",
Justification = "Rule predates more fluent naming conventions.")>]
member Property :
property:Expression<Func<'TEntity, 'TProperty>> -> DbPropertyEntry<'TEntity, 'TProperty>
JScript does not support generic types and methods.
類型參數
- TProperty
此屬性的類型。
參數
- property
類型:System.Linq.Expressions.Expression<Func<TEntity, TProperty>>
表示此屬性的運算式。
傳回值
類型:System.Data.Entity.Infrastructure.DbPropertyEntry<TEntity, TProperty>
表示屬性的物件。