共用方式為


EntityTypeConfiguration<TEntityType>.Ignore<TProperty> 方法

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

從模型中排除屬性,好讓它不會對應到資料庫。

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

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")> _
Public Function Ignore(Of TProperty) ( _
    propertyExpression As Expression(Of Func(Of TEntityType, TProperty)) _
) As EntityTypeConfiguration(Of TEntityType)
'用途
Dim instance As EntityTypeConfiguration 
Dim propertyExpression As Expression(Of Func(Of TEntityType, TProperty))
Dim returnValue As EntityTypeConfiguration(Of TEntityType)

returnValue = instance.Ignore(propertyExpression)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public EntityTypeConfiguration<TEntityType> Ignore<TProperty>(
    Expression<Func<TEntityType, TProperty>> propertyExpression
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1011:ConsiderPassingBaseTypesAsParameters")]
public:
generic<typename TProperty>
EntityTypeConfiguration<TEntityType>^ Ignore(
    Expression<Func<TEntityType, TProperty>^>^ propertyExpression
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")>]
member Ignore : 
        propertyExpression:Expression<Func<'TEntityType, 'TProperty>> -> EntityTypeConfiguration<'TEntityType> 
JScript does not support generic types and methods.

類型參數

  • TProperty
    要忽略之屬性的類型。

參數

傳回值

類型:System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<TEntityType>
相同的 EntityTypeConfiguration 執行個體,以便鏈結多個呼叫。

請參閱

參考

EntityTypeConfiguration<TEntityType> 類別

System.Data.Entity.ModelConfiguration 命名空間