共用方式為


EntityTypeBuilder<TEntity>.ComplexProperty 方法

定義

多載

ComplexProperty(String, Action<ComplexPropertyBuilder>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

傳回物件,這個物件可用來設定複雜類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

傳回物件,這個物件可用來設定複雜類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

傳回物件,這個物件可用來設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String)

傳回物件,這個物件可用來設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

ComplexProperty(String, Action<ComplexPropertyBuilder>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty (string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

參數

propertyName
String

要設定的屬性名稱。

buildAction
Action<ComplexPropertyBuilder>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

備註

使用這個多載新增屬性時,屬性名稱必須符合複雜類型上 CLR 屬性或欄位的名稱。 這個多載無法用來新增陰影狀態複雜屬性。

適用於

ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)

傳回物件,這個物件可用來設定複雜類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> 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.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

參數

propertyType
Type

要設定的屬性類型。

propertyName
String

要設定的屬性名稱。

buildAction
Action<ComplexPropertyBuilder>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

備註

加入新的複雜屬性時,如果具有相同名稱的屬性存在於複雜類別中,則會將其新增至模型。 如果複雜類別中沒有任何屬性存在,則會新增新的陰影狀態複雜屬性。 陰影狀態屬性是沒有複雜類別中對應屬性的陰影狀態屬性。 屬性的目前值會儲存在 中 ChangeTracker ,而不是儲存在複雜類別的實例中。

適用於

ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)

傳回物件,這個物件可用來設定複雜類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> 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.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder(Of TEntity)

參數

propertyType
Type

要設定的屬性類型。

propertyName
String

要設定的屬性名稱。

complexTypeName
String

複雜類型的名稱。

buildAction
Action<ComplexPropertyBuilder>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

備註

加入新的複雜屬性時,如果具有相同名稱的屬性存在於複雜類別中,則會將其新增至模型。 如果複雜類別中沒有任何屬性存在,則會新增新的陰影狀態複雜屬性。 陰影狀態屬性是沒有複雜類別中對應屬性的陰影狀態屬性。 屬性的目前值會儲存在 中 ChangeTracker ,而不是儲存在複雜類別的實例中。

適用於

ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> 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.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

類型參數

TProperty

要設定的屬性類型。

參數

propertyName
String

要設定的屬性名稱。

complexTypeName
String

複雜類型的名稱。

buildAction
Action<ComplexPropertyBuilder<TProperty>>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

備註

加入新的屬性時,如果具有相同名稱的屬性存在於複雜類別中,則會將它新增至模型。 如果複雜類別中沒有任何屬性存在,則會新增新的陰影狀態複雜屬性。 陰影狀態屬性是沒有複雜類別中對應屬性的陰影狀態屬性。 屬性的目前值會儲存在 中 ChangeTracker ,而不是儲存在複雜類別的實例中。

適用於

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

類型參數

TProperty

參數

propertyExpression
Expression<Func<TEntity,TProperty>>

Lambda 運算式,表示要設定 () blog => blog.Url 的屬性。

complexTypeName
String

複雜類型的名稱。

buildAction
Action<ComplexPropertyBuilder<TProperty>>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

適用於

ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果沒有具有指定名稱的屬性存在,則會加入新的屬性。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> 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.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

類型參數

TProperty

要設定的屬性類型。

參數

propertyName
String

要設定的屬性名稱。

buildAction
Action<ComplexPropertyBuilder<TProperty>>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

備註

加入新的屬性時,如果具有相同名稱的屬性存在於複雜類別中,則會將它新增至模型。 如果複雜類別中沒有任何屬性存在,則會新增新的陰影狀態複雜屬性。 陰影狀態屬性是沒有複雜類別中對應屬性的陰影狀態屬性。 屬性的目前值會儲存在 中 ChangeTracker ,而不是儲存在複雜類別的實例中。

適用於

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, Action<ComplexPropertyBuilder<TProperty>>)

設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder(Of TEntity)

類型參數

TProperty

參數

propertyExpression
Expression<Func<TEntity,TProperty>>

Lambda 運算式,表示要設定 () blog => blog.Url 的屬性。

buildAction
Action<ComplexPropertyBuilder<TProperty>>

執行屬性組態的動作。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

適用於

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>)

傳回物件,這個物件可用來設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty))) As ComplexPropertyBuilder(Of TProperty)

類型參數

TProperty

參數

propertyExpression
Expression<Func<TEntity,TProperty>>

Lambda 運算式,表示要設定 () blog => blog.Url 的屬性。

傳回

物件,可用來設定複雜屬性。

適用於

ComplexProperty<TProperty>(Expression<Func<TEntity,TProperty>>, String)

傳回物件,這個物件可用來設定實體類型的複雜屬性。 如果指定的屬性還不是模型的一部分,則會新增它。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression, string complexTypeName);
override this.ComplexProperty : System.Linq.Expressions.Expression<Func<'Entity, 'Property>> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyExpression As Expression(Of Func(Of TEntity, TProperty)), complexTypeName As String) As ComplexPropertyBuilder(Of TProperty)

類型參數

TProperty

參數

propertyExpression
Expression<Func<TEntity,TProperty>>

Lambda 運算式,表示要設定 () blog => blog.Url 的屬性。

complexTypeName
String

複雜類型的名稱。

傳回

可用來設定複雜屬性的物件。

適用於