RelationalForeignKeyExtensions.SetConstraintName 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
SetConstraintName(IMutableForeignKey, String) |
设置外键约束名称。 |
SetConstraintName(IConventionForeignKey, String, Boolean) |
设置外键约束名称。 |
SetConstraintName(IMutableForeignKey, String)
设置外键约束名称。
public static void SetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey foreignKey, string value);
public static void SetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey foreignKey, string? value);
static member SetConstraintName : Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey * string -> unit
<Extension()>
Public Sub SetConstraintName (foreignKey As IMutableForeignKey, value As String)
参数
- foreignKey
- IMutableForeignKey
外键。
- value
- String
要设置的值。
适用于
SetConstraintName(IConventionForeignKey, String, Boolean)
设置外键约束名称。
public static void SetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, string value, bool fromDataAnnotation = false);
public static string SetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, string value, bool fromDataAnnotation = false);
public static string? SetConstraintName (this Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, string? value, bool fromDataAnnotation = false);
static member SetConstraintName : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey * string * bool -> unit
static member SetConstraintName : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey * string * bool -> string
<Extension()>
Public Sub SetConstraintName (foreignKey As IConventionForeignKey, value As String, Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetConstraintName (foreignKey As IConventionForeignKey, value As String, Optional fromDataAnnotation As Boolean = false) As String
参数
- foreignKey
- IConventionForeignKey
外键。
- value
- String
要设置的值。
- fromDataAnnotation
- Boolean
指示配置是否是使用数据注释指定的。
返回
配置的名称。