ObjectContextOptions.UseConsistentNullReferenceBehavior 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个布尔值,该值确定是否使用一致的 NullReference 行为。
public:
property bool UseConsistentNullReferenceBehavior { bool get(); void set(bool value); };
public bool UseConsistentNullReferenceBehavior { get; set; }
member this.UseConsistentNullReferenceBehavior : bool with get, set
Public Property UseConsistentNullReferenceBehavior As Boolean
属性值
true 如果应使用一致的 NullReference 行为,则为否则,为 false.
注解
如果此标志设置为 falsenull,则当 FK 关系为 null 时,将 FK 关系的 Value 属性 EntityReference<TEntity> 设置为 null 将不起作用。 当此标志设置为 truenull 时,将值设置为 null 将始终导致 FK 为 null,即使该值当前为 null,也会删除关系。 默认值是 false 使用 ObjectContext 和使用 true DbContext 时。