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