Skip to main content
.NET 8.0+

XpoDefault.UseFastAccessors Property

Gets or sets whether XPO uses its internal mechanism to create new instances of persistent classes, and to set and retrieve object property values.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

Declaration

public static bool UseFastAccessors { get; set; }

Property Value

Type Description
Boolean

true if XPO uses its internal mechanism to create new instances of persistent classes, and to set and retrieve object property values; false, to use the Reflection.

Remarks

By default, XPO uses its internal mechanism to create new instances of persistent classes, and to set and retrieve object property values. This makes it possible to speed up the process of retrieving information about persistent classes. However, in some instances, this mechanism cannot be used (e.g. running in a medium trust hosted environment), and Reflection must be used instead. To do this, set the UseFastAccessors property to false (by default, it is set to true).

For example, to support a Medium Trust security policy, set the UseFastAccessors property to false and the XpoDefault.IdentityMapBehavior property to IdentityMapBehavior.Strong. All constructors/properties/fields of your persistent object must have the Public access modifier, so that XPO can access them without using Reflection.

See Also