DbEntityEntry<TEntity>.Property<TProperty> 方法 (Expression<Func<TEntity, TProperty>>)

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 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
    属性的类型。

参数

返回值

类型:System.Data.Entity.Infrastructure.DbPropertyEntry<TEntity, TProperty>
表示属性的对象。

请参阅

参考

DbEntityEntry<TEntity> 类

Property 重载

System.Data.Entity.Infrastructure 命名空间