语言

SqlServerPropertyAnnotations 类

定义

通过SqlServer(IMutableProperty)访问SQL Server特定批注的属性。

public class SqlServerPropertyAnnotations : Microsoft.EntityFrameworkCore.Metadata.RelationalPropertyAnnotations, Microsoft.EntityFrameworkCore.Metadata.ISqlServerPropertyAnnotations
type SqlServerPropertyAnnotations = class
    inherit RelationalPropertyAnnotations
    interface ISqlServerPropertyAnnotations
    interface IRelationalPropertyAnnotations
Public Class SqlServerPropertyAnnotations
Inherits RelationalPropertyAnnotations
Implements ISqlServerPropertyAnnotations
继承
SqlServerPropertyAnnotations
实现

构造函数

名称 说明
SqlServerPropertyAnnotations(IProperty)

构造给定 IProperty批注的实例。

SqlServerPropertyAnnotations(RelationalAnnotations)

构造由给定批注帮助程序表示的 IProperty 批注的实例。

字段

名称 说明
ProviderFullAnnotationNames

通过SqlServer(IMutableProperty)访问SQL Server特定批注的属性。

(继承自 RelationalPropertyAnnotations)

属性

名称 说明
Annotations

RelationalAnnotations表示批注的IProperty帮助程序。

(继承自 RelationalPropertyAnnotations)
ColumnName

属性映射到的列的名称。

(继承自 RelationalPropertyAnnotations)
ColumnType

属性映射到的列的数据库类型。

(继承自 RelationalPropertyAnnotations)
ComputedColumnSql

为此属性创建列时应使用的计算约束 SQL 表达式。

(继承自 RelationalPropertyAnnotations)
DefaultValue

为此属性创建列时要在列定义中使用的默认值。

(继承自 RelationalPropertyAnnotations)
DefaultValueSql

为此属性创建列时应使用的默认约束 SQL 表达式。

(继承自 RelationalPropertyAnnotations)
HiLoSequenceName

获取或设置要用于 的序列名称 ForSqlServerUseSequenceHiLo(PropertyBuilder, String, String)

HiLoSequenceSchema

获取或设置要使用的序列的架构 ForSqlServerUseSequenceHiLo(PropertyBuilder, String, String)

IsFixedLength

一个标志,指示属性是否能够仅存储固定长度的数据,例如字符串。

(继承自 RelationalPropertyAnnotations)
Property

要 IProperty 批注。

(继承自 RelationalPropertyAnnotations)
ShouldThrowOnConflict

指示是否应在设置冲突配置时引发异常。 使用 Fluent API 实现最后一次调用会赢得语义时,通常会重写此情况。

(继承自 RelationalPropertyAnnotations)
ShouldThrowOnInvalidConfiguration

指示在设置无效配置时是否应引发异常。

(继承自 RelationalPropertyAnnotations)
ValueGenerationStrategy

获取或设置 SqlServerValueGenerationStrategy 要用于属性的项。

如果未为属性设置任何策略,则要使用的策略将从 IModel

方法

名称 说明
CanSetComputedColumnSql(String)

检查是否对属性设置计算的 SQL 表达式有效。

CanSetDefaultValue(Object)

检查是否对属性设置默认值有效。

CanSetDefaultValueSql(String)

检查是否对属性设置默认 SQL 表达式有效。

CanSetValueGenerationStrategy(Nullable<SqlServerValueGenerationStrategy>)

检查是否对属性设置给定 SqlServerValueGenerationStrategy 值是否有效。

ClearAllServerGeneratedValues()

将属性的值生成重置为默认值。

FindHiLoSequence()

查找 ISequence 要使用的模型中 ForSqlServerUseSequenceHiLo(PropertyBuilder, String, String)

GetAnnotations(IEntityType)

RelationalEntityTypeAnnotations获取给定IEntityType实例的实例,RelationalAnnotations该实例用来控制按约定设置批注的语义。

(继承自 RelationalPropertyAnnotations)
GetAnnotations(IProperty)

RelationalPropertyAnnotations获取给定IProperty实例的实例,RelationalAnnotations该实例用来控制按约定设置批注的语义。

(继承自 RelationalPropertyAnnotations)
GetComputedColumnSql(Boolean)

获取属性的计算 SQL 表达式集。

GetDefaultValue(Boolean)

获取为属性设置的默认值。

GetDefaultValueSql(Boolean)

获取属性的默认 SQL 表达式集。

GetSqlServerValueGenerationStrategy(Boolean)

获取或设置 SqlServerValueGenerationStrategy 要用于属性的项。

SetColumnName(String)

尝试使用中的语义RelationalAnnotations设置ColumnName。

(继承自 RelationalPropertyAnnotations)
SetColumnType(String)

尝试使用中的语义RelationalAnnotations设置ColumnType。

(继承自 RelationalPropertyAnnotations)
SetComputedColumnSql(String)

尝试使用中的语义RelationalAnnotations设置ComputedColumnSql。

(继承自 RelationalPropertyAnnotations)
SetDefaultValue(Object)

尝试使用中的语义RelationalAnnotations设置DefaultValue。

(继承自 RelationalPropertyAnnotations)
SetDefaultValueSql(String)

尝试使用中的语义RelationalAnnotations设置DefaultValueSql。

(继承自 RelationalPropertyAnnotations)
SetFixedLength(Boolean)

将属性配置为仅存储固定长度的数据,例如字符串。

(继承自 RelationalPropertyAnnotations)
SetHiLoSequenceName(String)

设置要与 .一起使用 ForSqlServerUseSequenceHiLo(PropertyBuilder, String, String)的序列名称。

SetHiLoSequenceSchema(String)

设置序列要使用的 ForSqlServerUseSequenceHiLo(PropertyBuilder, String, String)架构。

SetValueGenerationStrategy(Nullable<SqlServerValueGenerationStrategy>)

设置 SqlServerValueGenerationStrategy 要用于属性的设置。

适用于