Share via


ObjectContextOptions.UseCSharpNullComparisonBehavior Property

Definition

Gets or sets a Boolean value that determines whether to use the C# NullComparison behavior.

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

Property Value

true if the C# NullComparison behavior should be used; otherwise, false.

Remarks

This flag determines whether C# behavior should be exhibited when comparing null values in LinqToEntities. If this flag is set, then any equality comparison between two operands, both of which are potentially nullable, will be rewritten to show C# null comparison semantics. As an example: (operand1 = operand2) will be rewritten as (((operand1 = operand2) AND NOT (operand1 IS NULL OR operand2 IS NULL)) || (operand1 IS NULL && operand2 IS NULL)) The default value is false when using ObjectContext.

Applies to