RuntimeTypeBase.AddComplexProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將複雜屬性加入至這個實體類型。
public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty AddComplexProperty (string name, Type clrType, string targetTypeName, Type targetType, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, bool nullable = false, bool collection = false, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy changeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, System.Reflection.PropertyInfo? indexerPropertyInfo = default, bool propertyBag = false);
abstract member AddComplexProperty : string * Type * string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty
override this.AddComplexProperty : string * Type * string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeComplexProperty
Public Overridable Function AddComplexProperty (name As String, clrType As Type, targetTypeName As String, targetType As Type, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, Optional nullable As Boolean = false, Optional collection As Boolean = false, Optional changeTrackingStrategy As ChangeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, Optional indexerPropertyInfo As PropertyInfo = Nothing, Optional propertyBag As Boolean = false) As RuntimeComplexProperty
參數
- name
- String
要加入的屬性名稱。
- clrType
- Type
屬性將保留的數值型別。
- targetTypeName
- String
要加入的複雜型別名稱。
- targetType
- Type
用來表示這個複雜型別實例的 CLR 型別。
- propertyInfo
- PropertyInfo
對應的 CLR 屬性或 null
陰影屬性。
- fieldInfo
- FieldInfo
陰影屬性的對應 CLR 欄位或 null
。
- propertyAccessMode
- PropertyAccessMode
PropertyAccessMode用於這個屬性的 。
- nullable
- Boolean
值,指出這個屬性是否可以包含 null
。
- collection
- Boolean
指出 屬性是否代表集合。
- changeTrackingStrategy
- ChangeTrackingStrategy
這個複雜類型的變更追蹤策略。
- indexerPropertyInfo
- PropertyInfo
PropertyInfo如果存在,則為相關聯 CLR 型別上索引子的 。
- propertyBag
- Boolean
值,指出這個實體類型是否有索引子,其能夠包含任意屬性,以及可用來判斷指定索引子屬性是否包含值的方法。
傳回
新建立的屬性。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應