DbContextConfiguration.UseDatabaseNullSemantics 属性

定义

获取或设置一个值,该值指示在比较两个操作数(这两个操作数可能为 null)时是否显示数据库 null 语义。 默认值为 false。

例如, (operand1 == operand2) 将转换为:

(操作数1 = operand2)

如果 UseDatabaseNullSemantics 为 true,则分别为

( ( (operand1 = operand2) AND (NOT (operand1 IS NULL 或 operand2 IS NULL) ) ) OR ( (operand1 IS NULL) and (operand2 IS NULL) ) )

如果 UseDatabaseNullSemantics 为 false,则为 。

public bool UseDatabaseNullSemantics { get; set; }
member this.UseDatabaseNullSemantics : bool with get, set
Public Property UseDatabaseNullSemantics As Boolean

属性值

true 如果启用了数据库 null 比较行为,则为 ;否则为 false

适用于