ObjectContextOptions.UseCSharpNullComparisonBehavior Property

 

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

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

public bool UseCSharpNullComparisonBehavior {
	[CompilerGeneratedAttribute]
	get;
	[CompilerGeneratedAttribute]
	set;
}

Property Value

Type: System.Boolean

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

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.