EntityTypeBuilder.ComplexProperty 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ComplexProperty(String) |
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(String, Action<ComplexPropertyBuilder>) |
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(Type, String) |
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(Type, String, Action<ComplexPropertyBuilder>) |
返回一个 对象,该对象可用于配置复杂类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(Type, String, String) |
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>) |
返回一个 对象,该对象可用于配置复杂类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>) |
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty<TProperty>(String, String) |
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty<TProperty>(String) |
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>) |
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。 |
ComplexProperty(String)
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder ComplexProperty (string propertyName);
abstract member ComplexProperty : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
override this.ComplexProperty : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
Public Overridable Function ComplexProperty (propertyName As String) As ComplexPropertyBuilder
参数
- propertyName
- String
要配置的属性的名称。
返回
可用于配置 属性的 对象。
注解
添加具有此重载的新属性时,属性名称必须与实体类型上的 CLR 属性或字段的名称匹配。 此重载不能用于添加新的阴影状态复杂属性。
适用于
ComplexProperty(String, Action<ComplexPropertyBuilder>)
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ComplexProperty (string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
abstract member ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
Public Overridable Function ComplexProperty (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder
参数
- propertyName
- String
要配置的属性的名称。
- buildAction
- Action<ComplexPropertyBuilder>
执行属性配置的操作。
返回
同一个生成器实例,以便可以链接多个配置调用。
注解
添加具有此重载的新属性时,属性名称必须与复杂类型上的 CLR 属性或字段的名称匹配。 此重载不能用于添加新的阴影状态复杂属性。
适用于
ComplexProperty(Type, String)
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder ComplexProperty (Type propertyType, string propertyName);
abstract member ComplexProperty : Type * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
override this.ComplexProperty : Type * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String) As ComplexPropertyBuilder
参数
- propertyType
- Type
要配置的属性的类型。
- propertyName
- String
要配置的属性的名称。
返回
可用于配置 属性的 对象。
注解
添加新的复杂属性时,如果实体类中存在同名的属性,则会将其添加到模型中。 如果实体类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是实体类中没有相应属性的属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在实体类的实例中。
适用于
ComplexProperty(Type, String, Action<ComplexPropertyBuilder>)
返回一个 对象,该对象可用于配置复杂类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ComplexProperty (Type propertyType, string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
abstract member ComplexProperty : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
override this.ComplexProperty : Type * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder
参数
- propertyType
- Type
要配置的属性的类型。
- propertyName
- String
要配置的属性的名称。
- buildAction
- Action<ComplexPropertyBuilder>
执行属性配置的操作。
返回
同一个生成器实例,以便可以链接多个配置调用。
注解
添加新的复杂属性时,如果复杂类中存在同名的属性,则该属性将添加到模型中。 如果复杂类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是在复杂类中没有对应属性的阴影状态属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在复杂类的实例中。
适用于
ComplexProperty(Type, String, String)
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder ComplexProperty (Type propertyType, string propertyName, string complexTypeName);
abstract member ComplexProperty : Type * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
override this.ComplexProperty : Type * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, complexTypeName As String) As ComplexPropertyBuilder
参数
- propertyType
- Type
要配置的属性的类型。
- propertyName
- String
要配置的属性的名称。
- complexTypeName
- String
复杂类型的名称。
返回
可用于配置 属性的 对象。
注解
添加新的复杂属性时,如果实体类中存在同名的属性,则会将其添加到模型中。 如果实体类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是实体类中没有相应属性的属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在实体类的实例中。
适用于
ComplexProperty(Type, String, String, Action<ComplexPropertyBuilder>)
返回一个 对象,该对象可用于配置复杂类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ComplexProperty (Type propertyType, string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> buildAction);
abstract member ComplexProperty : Type * string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
override this.ComplexProperty : Type * string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
Public Overridable Function ComplexProperty (propertyType As Type, propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder)) As EntityTypeBuilder
参数
- propertyType
- Type
要配置的属性的类型。
- propertyName
- String
要配置的属性的名称。
- complexTypeName
- String
复杂类型的名称。
- buildAction
- Action<ComplexPropertyBuilder>
执行属性配置的操作。
返回
同一个生成器实例,以便可以链接多个配置调用。
注解
添加新的复杂属性时,如果复杂类中存在同名的属性,则该属性将添加到模型中。 如果复杂类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是在复杂类中没有对应属性的阴影状态属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在复杂类的实例中。
适用于
ComplexProperty<TProperty>(String, String, Action<ComplexPropertyBuilder<TProperty>>)
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ComplexProperty<TProperty> (string propertyName, string complexTypeName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
abstract member ComplexProperty : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
override this.ComplexProperty : string * string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, complexTypeName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder
类型参数
- TProperty
要配置的属性的类型。
参数
- propertyName
- String
要配置的属性的名称。
- complexTypeName
- String
复杂类型的名称。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
执行属性配置的操作。
返回
同一个生成器实例,以便可以链接多个配置调用。
注解
添加新属性时,如果复杂类中存在同名的属性,则会将其添加到模型中。 如果复杂类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是在复杂类中没有对应属性的阴影状态属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在复杂类的实例中。
适用于
ComplexProperty<TProperty>(String, String)
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (string propertyName, string complexTypeName);
abstract member ComplexProperty : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
override this.ComplexProperty : string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, complexTypeName As String) As ComplexPropertyBuilder(Of TProperty)
类型参数
- TProperty
要配置的属性的类型。
参数
- propertyName
- String
要配置的属性的名称。
- complexTypeName
- String
复杂类型的名称。
返回
可用于配置 属性的 对象。
注解
添加新属性时,如果实体类中存在同名的属性,则会将其添加到模型中。 如果实体类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是实体类中没有相应属性的属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在实体类的实例中。
适用于
ComplexProperty<TProperty>(String)
返回一个对象,该对象可用于配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty> ComplexProperty<TProperty> (string propertyName);
abstract member ComplexProperty : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
override this.ComplexProperty : string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String) As ComplexPropertyBuilder(Of TProperty)
类型参数
- TProperty
要配置的属性的类型。
参数
- propertyName
- String
要配置的属性的名称。
返回
可用于配置 属性的 对象。
注解
添加新属性时,如果实体类中存在同名的属性,则会将其添加到模型中。 如果实体类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是实体类中没有相应属性的属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在实体类的实例中。
适用于
ComplexProperty<TProperty>(String, Action<ComplexPropertyBuilder<TProperty>>)
配置实体类型的复杂属性。 如果不存在具有给定名称的属性,则将添加新属性。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ComplexProperty<TProperty> (string propertyName, Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<TProperty>> buildAction);
abstract member ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
override this.ComplexProperty : string * Action<Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexPropertyBuilder<'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
Public Overridable Function ComplexProperty(Of TProperty) (propertyName As String, buildAction As Action(Of ComplexPropertyBuilder(Of TProperty))) As EntityTypeBuilder
类型参数
- TProperty
要配置的属性的类型。
参数
- propertyName
- String
要配置的属性的名称。
- buildAction
- Action<ComplexPropertyBuilder<TProperty>>
执行属性配置的操作。
返回
同一个生成器实例,以便可以链接多个配置调用。
注解
添加新属性时,如果复杂类中存在同名的属性,则会将其添加到模型中。 如果复杂类中不存在任何属性,则将添加新的阴影状态复杂属性。 阴影状态属性是在复杂类中没有对应属性的阴影状态属性。 属性的当前值存储在 中, ChangeTracker 而不是存储在复杂类的实例中。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈