RelationalReferenceOwnershipBuilderExtensions.HasConstraintName 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
HasConstraintName(ReferenceOwnershipBuilder, String) |
面向关系数据库时,为此关系配置外键约束名称。 |
HasConstraintName<TEntity,TRelatedEntity>(ReferenceOwnershipBuilder<TEntity,TRelatedEntity>, String) |
面向关系数据库时,为此关系配置外键约束名称。 |
HasConstraintName(ReferenceOwnershipBuilder, String)
面向关系数据库时,为此关系配置外键约束名称。
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder HasConstraintName (this Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder referenceReferenceBuilder, string name);
static member HasConstraintName : Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder
<Extension()>
Public Function HasConstraintName (referenceReferenceBuilder As ReferenceOwnershipBuilder, name As String) As ReferenceOwnershipBuilder
参数
- referenceReferenceBuilder
- ReferenceOwnershipBuilder
用于配置关系的生成器。
- name
- String
外键约束的名称。
返回
同一生成器实例,以便可以链接多个调用。
适用于
HasConstraintName<TEntity,TRelatedEntity>(ReferenceOwnershipBuilder<TEntity,TRelatedEntity>, String)
面向关系数据库时,为此关系配置外键约束名称。
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> HasConstraintName<TEntity,TRelatedEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<TEntity,TRelatedEntity> referenceReferenceBuilder, string name) where TEntity : class where TRelatedEntity : class;
static member HasConstraintName : Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ReferenceOwnershipBuilder<'Entity, 'RelatedEntity (requires 'Entity : null and 'RelatedEntity : null)> (requires 'Entity : null and 'RelatedEntity : null)
<Extension()>
Public Function HasConstraintName(Of TEntity As Class, TRelatedEntity As Class) (referenceReferenceBuilder As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity), name As String) As ReferenceOwnershipBuilder(Of TEntity, TRelatedEntity)
类型参数
- TEntity
关系一端的实体类型。
- TRelatedEntity
关系另一端的实体类型。
参数
- referenceReferenceBuilder
- ReferenceOwnershipBuilder<TEntity,TRelatedEntity>
用于配置关系的生成器。
- name
- String
外键约束的名称。
返回
同一生成器实例,以便可以链接多个调用。