ComplexPropertyBuilder<TComplex>.ComplexProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ComplexProperty(String, Action<ComplexPropertyBuilder>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty(string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As ComplexPropertyBuilder(Of TComplex)
參數
- propertyName
- String
要設定的物業名稱。
- buildAction
- Action<ComplexPropertyBuilder>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增帶有此過載的屬性時,屬性名稱必須與複雜型態中 CLR 屬性或欄位的名稱相符。 此過載無法用來新增陰影狀態複體屬性。
適用於
ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty(Type propertyType, string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As ComplexPropertyBuilder(Of TComplex)
參數
- propertyType
- Type
要設定的財產類型。
- propertyName
- String
要設定的物業名稱。
- buildAction
- Action<ComplexPropertyBuilder>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增複數屬性時,若複數類別中有同名屬性,則該物件會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty(Type propertyType, string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : Type * string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder)) As ComplexPropertyBuilder(Of TComplex)
參數
- propertyType
- Type
要設定的財產類型。
- propertyName
- String
要設定的物業名稱。
- complexTypeName
- String
複雜類型的名稱。
- buildAction
- Action<ComplexPropertyBuilder>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增複數屬性時,若複數類別中有同名屬性,則該物件會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyName
- String
要設定的物業名稱。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyName
- String
要設定的物業名稱。
- complexTypeName
- String
複雜類型的名稱。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty>> propertyExpression, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, 'Property>> * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TComplex, TProperty)), complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,TProperty>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- complexTypeName
- String
複雜類型的名稱。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,Nullable<TProperty>>>, String, Action<ComplexPropertyBuilder<TProperty>>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction) where TProperty : struct;
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, Nullable<'Property>>> * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex> (requires 'Property : struct)
Public Overridable Function ComplexProperty(Of TProperty As Structure) (propertyExpression As Expression(Of Func(Of TComplex, Nullable(Of TProperty))), complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,Nullable<TProperty>>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- complexTypeName
- String
複雜類型的名稱。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,TProperty>>, String)
回傳一個物件,可用來配置複雜型態的複雜屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, string complexTypeName);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty>> propertyExpression, string complexTypeName);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, 'Property>> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TComplex, TProperty)), complexTypeName As String) As ComplexPropertyBuilder(Of TProperty)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,TProperty>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- complexTypeName
- String
複雜類型的名稱。
傳回
一個可以用來設定屬性的物件。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,Nullable<TProperty>>>, Action<ComplexPropertyBuilder<TProperty>>)
配置一個複數屬性的複數屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction) where TProperty : struct;
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, Nullable<'Property>>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex> (requires 'Property : struct)
Public Overridable Function ComplexProperty(Of TProperty As Structure) (propertyExpression As Expression(Of Func(Of TComplex, Nullable(Of TProperty))), buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,Nullable<TProperty>>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,Nullable<TProperty>>>, String)
回傳一個物件,可用來配置複雜型態的複雜屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, string complexTypeName) where TProperty : struct;
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, Nullable<'Property>>> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property (requires 'Property : struct)> (requires 'Property : struct)
Public Overridable Function ComplexProperty(Of TProperty As Structure) (propertyExpression As Expression(Of Func(Of TComplex, Nullable(Of TProperty))), complexTypeName As String) As ComplexPropertyBuilder(Of TProperty)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,Nullable<TProperty>>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- complexTypeName
- String
複雜類型的名稱。
傳回
一個可以用來設定屬性的物件。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)
回傳一個物件,可用來配置複雜型態的複雜屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TComplex> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty>> propertyExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, 'Property>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Complex>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TComplex, TProperty)), buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As ComplexPropertyBuilder(Of TComplex)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,TProperty>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
一個執行屬性配置的動作。
傳回
同一個建構器實例,這樣可以串接多個設定呼叫。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,TProperty>>)
回傳一個物件,可用來配置複雜型態的複雜屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty>> propertyExpression);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TComplex, TProperty))) As ComplexPropertyBuilder(Of TProperty)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,TProperty>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
傳回
一個可以用來設定屬性的物件。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。
適用於
ComplexProperty<TProperty>(Expression<Func<TComplex,Nullable<TProperty>>>)
回傳一個物件,可用來配置複雜型態的複雜屬性。 若不存在帶有該名稱的屬性,則會新增一個屬性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty>(System.Linq.Expressions.Expression<Func<TComplex,TProperty?>> propertyExpression) where TProperty : struct;
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Complex, Nullable<'Property>>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property (requires 'Property : struct)> (requires 'Property : struct)
Public Overridable Function ComplexProperty(Of TProperty As Structure) (propertyExpression As Expression(Of Func(Of TComplex, Nullable(Of TProperty)))) As ComplexPropertyBuilder(Of TProperty)
類型參數
- TProperty
要設定的財產類型。
參數
- propertyExpression
- Expression<Func<TComplex,Nullable<TProperty>>>
一個表示要配置屬性的 lambda 表達式( blog => blog.Url)。
傳回
一個可以用來設定屬性的物件。
備註
新增屬性時,如果複合類別中存在同名屬性,則該屬性會被加入模型中。 若複數類別中不存在性質,則會新增一個影子狀態複數性質。 影子狀態性質是指在複數類別中沒有對應性質的性質。 屬性的當前值會儲存在 中 ChangeTracker ,而非存放在複雜類別的實例中。