ObjectContextOptions 类

定义

定义影响 ObjectContext 的行为的选项。Defines options that affect the behavior of the ObjectContext.

public ref class ObjectContextOptions sealed
public sealed class ObjectContextOptions
type ObjectContextOptions = class
Public NotInheritable Class ObjectContextOptions
继承
ObjectContextOptions

属性

LazyLoadingEnabled

获取或设置一个布尔值,该值确定在访问导航属性时是否自动加载相关对象。Gets or sets a Boolean value that determines whether related objects are loaded automatically when a navigation property is accessed.

ProxyCreationEnabled

获取或设置一个布尔值,该值确定是否为持久性未知的自定义数据类创建代理实例。Gets or sets a Boolean value that determines whether proxy instances are created for custom data classes that are persistence ignorant.

UseConsistentNullReferenceBehavior

获取或设置是否用一致 NullReference 行为的“布尔”值。Gets or sets a Boolean value that determines whether to use the consistent NullReference behavior.

UseCSharpNullComparisonBehavior

获取或设置是否用 C# NullComparison 行为的“布尔”值。Gets or sets a Boolean value that determines whether to use the C# NullComparison behavior.

UseLegacyPreserveChangesBehavior

获取或设置确定是否使用旧式 PreserveChanges 行为的布尔值。Gets or sets a Boolean value that determines whether to use the legacy PreserveChanges behavior.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于