ComplexTypeConfiguration<TComplexType>.Ignore<TProperty> 方法
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
從模型中排除屬性,好讓它不會對應到資料庫。
命名空間: System.Data.Entity.ModelConfiguration
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")> _
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
Public Function Ignore(Of TProperty) ( _
propertyExpression As Expression(Of Func(Of TComplexType, TProperty)) _
) As ComplexTypeConfiguration(Of TComplexType)
'用途
Dim instance As ComplexTypeConfiguration
Dim propertyExpression As Expression(Of Func(Of TComplexType, TProperty))
Dim returnValue As ComplexTypeConfiguration(Of TComplexType)
returnValue = instance.Ignore(propertyExpression)
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public ComplexTypeConfiguration<TComplexType> Ignore<TProperty>(
Expression<Func<TComplexType, TProperty>> propertyExpression
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
public:
generic<typename TProperty>
ComplexTypeConfiguration<TComplexType>^ Ignore(
Expression<Func<TComplexType, TProperty>^>^ propertyExpression
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
member Ignore :
propertyExpression:Expression<Func<'TComplexType, 'TProperty>> -> ComplexTypeConfiguration<'TComplexType>
JScript does not support generic types and methods.
類型參數
- TProperty
要忽略之屬性的類型。
參數
- propertyExpression
類型:System.Linq.Expressions.Expression<Func<TComplexType, TProperty>>
Lambda 運算式,表示要設定的屬性。 C#:t => t.MyProperty VB.Net:Function(t) t.MyProperty
傳回值
類型:System.Data.Entity.ModelConfiguration.ComplexTypeConfiguration<TComplexType>
相同的 ComplexTypeConfiguration 執行個體,以便鏈結多個呼叫。