Skip to main content
All docs
V24.1
.NET Framework 4.5.2+

PersistentBase.UseUnsafeCreateCollectionStrategy Field

Specifies whether the return value type of the XPCustomMemberInfo.GetValue method can be different than the XPCustomMemberInfo.MemberType property value.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public static bool UseUnsafeCreateCollectionStrategy

Field Value

Type Description
Boolean

true if the XPCustomMemberInfo.GetValue method can return a value of any type. false if the XPCustomMemberInfo.GetValue method should throw the InvalidCastException when the return value type does not match the XPCustomMemberInfo.MemberType property value.

Remarks

The UseUnsafeCreateCollectionStrategy property is in effect only when the XPCustomMemberInfo.MemberType property is set to typeof(XPCollection<T>) or typeof(IList<T>). Otherwise, the XPCustomMemberInfo.GetValue method does not raise the InvalidCastException when the result value type does not match the XPCustomMemberInfo.MemberType property value.

See Also