语言

ObjectContextOptions.UseCSharpNullComparisonBehavior 属性

定义

获取或设置一个布尔值,该值确定是否使用 C# NullComparison 行为。

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

属性值

如果应使用 C# NullComparison 行为,则为 true;否则为 false。

注解

此标志确定在比较 LinqToEntities 中的 null 值时是否应显示 C# 行为。 如果设置了此标志,则会重写两个操作数之间的任何相等比较(这两个操作数都可能可为 null),以显示 C# null 比较语义。 例如:(operand1 = operand2)将重写为 ((operand1 = operand2) AND NOT (operand1 IS NULL OR operand2 IS NULL)) ||(operand1 IS NULL && operand2 IS NULL))使用 ObjectContext时默认值为 false。

适用于