Table of Contents

Class PersistentBase

Namespace
DevExpress.Xpo
Assembly
DevExpress.Xpo.v24.1.dll

Serves as a base for classes that represent persistent objects.

[NonPersistent]
[MemberDesignTimeVisibility(false)]
[OptimisticLocking(true)]
public class PersistentBase : IXPObject, IXPSimpleObject, IXPClassInfoAndSessionProvider, IXPClassInfoProvider, ISessionProvider, IObjectLayerProvider, IDataLayerProvider, IXPDictionaryProvider, IXPCustomPropertyStore, IXPModificationsStore, IXPInvalidateableObject, IXPReceiveOnChangedFromDelayedProperty, IXPReceiveOnChangedFromArbitrarySource, INotifyPropertyChanged, IXPImmutableHashCode
Inheritance
PersistentBase
Implements
Derived
Inherited Members

Constructors

PersistentBase(Session)

protected PersistentBase(Session session)

Parameters

session Session

PersistentBase(Session, XPClassInfo)

Initializes a new instance of the PersistentBase class.

public PersistentBase(Session session, XPClassInfo classInfo)

Parameters

session Session

A Session object that represents the session used to load and save persistent objects. This value is assigned to the PersistentBase.Session property.

classInfo XPClassInfo

An XPClassInfo descendant which provides the class metadata. This value is assigned to the PersistentBase.ClassInfo property.

Properties

ClassInfo

Gets a value that provides access to the metadata information of a class gathered via Reflection.

[MemberDesignTimeVisibility(false)]
[Browsable(false)]
public XPClassInfo ClassInfo { get; }

Property Value

XPClassInfo

An XPClassInfo descendant which provides the class metadata.

Fields

Gets an object that contains field identifiers for Simplified Criteria Syntax.

public static PersistentBase.FieldsClass Fields { get; }

Property Value

PersistentBase.FieldsClass

The FieldsClass object that can contain field identifies.

IsDeleted

Indicates whether the current persistent object is marked as deleted.

[Browsable(false)]
[MemberDesignTimeVisibility(false)]
public bool IsDeleted { get; }

Property Value

bool

true if the current object is marked as deleted; otherwise, false.

IsInvalidated

protected virtual bool IsInvalidated { get; }

Property Value

bool

IsLoading

Indicates whether the object is currently being initialized.

[MemberDesignTimeVisibility(false)]
[Browsable(false)]
public bool IsLoading { get; }

Property Value

bool

true if the object is currently being initialized; otherwise, false.

IsSaving

[MemberDesignTimeVisibility(false)]
[Browsable(false)]
protected bool IsSaving { get; }

Property Value

bool

Session

Gets the session used to load and save persistent objects.

[MemberDesignTimeVisibility(false)]
[Browsable(false)]
public Session Session { get; }

Property Value

Session

A Session object that represents the session used to load and save persistent objects.

Methods

AfterConstruction()

Invoked when the current object is about to be initialized after its creation.

public virtual void AfterConstruction()

CreateAssociationList(XPMemberInfo)

protected virtual IList CreateAssociationList(XPMemberInfo property)

Parameters

property XPMemberInfo

Returns

IList

CreateAssociationList<T>(XPMemberInfo)

protected virtual IList<T> CreateAssociationList<T>(XPMemberInfo property)

Parameters

property XPMemberInfo

Returns

IList<T>

Type Parameters

T

CreateCollection(XPMemberInfo)

protected virtual XPCollection CreateCollection(XPMemberInfo property)

Parameters

property XPMemberInfo

Returns

XPCollection

CreateCollection<T>(XPMemberInfo)

protected virtual XPCollection<T> CreateCollection<T>(XPMemberInfo property)

Parameters

property XPMemberInfo

Returns

XPCollection<T>

Type Parameters

T

CreateManyToManyAliasList(IList, XPMemberInfo)

protected virtual IList CreateManyToManyAliasList(IList aliasedCollection, XPMemberInfo skippedProperty)

Parameters

aliasedCollection IList
skippedProperty XPMemberInfo

Returns

IList

CreateManyToManyAliasList<T>(IList, XPMemberInfo)

protected virtual IList<T> CreateManyToManyAliasList<T>(IList aliasedCollection, XPMemberInfo skippedProperty)

Parameters

aliasedCollection IList
skippedProperty XPMemberInfo

Returns

IList<T>

Type Parameters

T

CustomCreateCollection(XPMemberInfo)

protected virtual XPBaseCollection CustomCreateCollection(XPMemberInfo property)

Parameters

property XPMemberInfo

Returns

XPBaseCollection

Equals(object)

Determines whether the current object has the same settings as the specified object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the object specified by the parameter has the same settings as the current object; otherwise, false.

GetCustomPropertyStore(object)

This member supports the internal infrastructure and isn’t intended to be used directly from your code.

public static IXPCustomPropertyStore GetCustomPropertyStore(object theObject)

Parameters

theObject object

Returns

IXPCustomPropertyStore

GetDelayedPropertyValue(string)

protected object GetDelayedPropertyValue(string propertyName = null)

Parameters

propertyName string

Returns

object

GetDelayedPropertyValue<T>(string)

protected T GetDelayedPropertyValue<T>(string propertyName = null)

Parameters

propertyName string

Returns

T

Type Parameters

T

GetHashCode()

Gets the hash code (a number) that corresponds to the value of the current PersistentBase object.

public override int GetHashCode()

Returns

int

An integer value representing the hash code for the current object.

GetList(string)

protected IList GetList(string propertyName = null)

Parameters

propertyName string

Returns

IList

GetList<T>(string)

protected IList<T> GetList<T>(string propertyName = null)

Parameters

propertyName string

Returns

IList<T>

Type Parameters

T

GetModificationsStore(object)

Returns an object that stores information about the modified properties when the Session.TrackPropertiesModifications option is enabled.

public static IXPModificationsStore GetModificationsStore(object theObject)

Parameters

theObject object

A persistent object that is modified.

Returns

IXPModificationsStore

An IXPModificationsStore object that stores information about the modified properties.

GetPropertyValue(string)

protected object GetPropertyValue(string propertyName = null)

Parameters

propertyName string

Returns

object

GetPropertyValue<T>(string)

protected T GetPropertyValue<T>(string propertyName = null)

Parameters

propertyName string

Returns

T

Type Parameters

T

Invalidate(bool)

protected virtual void Invalidate(bool disposing)

Parameters

disposing bool

OnChanged(string, object, object)

Invoked after an object’s property has been changed.

protected virtual void OnChanged(string propertyName, object oldValue, object newValue)

Parameters

propertyName string

A property whose value was changed.

oldValue object

An old value.

newValue object

A new value.

OnDeleted()

protected virtual void OnDeleted()

OnDeleting()

Invoked when the current object is about to be deleted.

protected virtual void OnDeleting()

OnLoaded()

protected virtual void OnLoaded()

OnLoading()

protected virtual void OnLoading()

OnSaved()

protected virtual void OnSaved()

OnSaving()

Invoked when the current object is about to be saved.

protected virtual void OnSaving()

RaisePropertyChangedEvent(string)

protected void RaisePropertyChangedEvent(string propertyName)

Parameters

propertyName string

SetDelayedPropertyValue(string, object)

protected bool SetDelayedPropertyValue(string propertyName, object newValue)

Parameters

propertyName string
newValue object

Returns

bool

SetDelayedPropertyValue<T>(string, T)

protected bool SetDelayedPropertyValue<T>(string propertyName, T newValue)

Parameters

propertyName string
newValue T

Returns

bool

Type Parameters

T

SetPropertyValue(string, ref bool, bool)

protected bool SetPropertyValue(string propertyName, ref bool propertyValueHolder, bool newValue)

Parameters

propertyName string
propertyValueHolder bool
newValue bool

Returns

bool

SetPropertyValue(string, ref DateTime, DateTime)

protected bool SetPropertyValue(string propertyName, ref DateTime propertyValueHolder, DateTime newValue)

Parameters

propertyName string
propertyValueHolder DateTime
newValue DateTime

Returns

bool

SetPropertyValue(string, ref decimal, decimal)

protected bool SetPropertyValue(string propertyName, ref decimal propertyValueHolder, decimal newValue)

Parameters

propertyName string
propertyValueHolder decimal
newValue decimal

Returns

bool

SetPropertyValue(string, ref double, double)

protected bool SetPropertyValue(string propertyName, ref double propertyValueHolder, double newValue)

Parameters

propertyName string
propertyValueHolder double
newValue double

Returns

bool

SetPropertyValue(string, ref Guid, Guid)

protected bool SetPropertyValue(string propertyName, ref Guid propertyValueHolder, Guid newValue)

Parameters

propertyName string
propertyValueHolder Guid
newValue Guid

Returns

bool

SetPropertyValue(string, ref int, int)

protected bool SetPropertyValue(string propertyName, ref int propertyValueHolder, int newValue)

Parameters

propertyName string
propertyValueHolder int
newValue int

Returns

bool

SetPropertyValue(string, ref long, long)

protected bool SetPropertyValue(string propertyName, ref long propertyValueHolder, long newValue)

Parameters

propertyName string
propertyValueHolder long
newValue long

Returns

bool

SetPropertyValue(string, ref bool?, bool?)

protected bool SetPropertyValue(string propertyName, ref bool? propertyValueHolder, bool? newValue)

Parameters

propertyName string
propertyValueHolder bool?
newValue bool?

Returns

bool

SetPropertyValue(string, ref DateTime?, DateTime?)

protected bool SetPropertyValue(string propertyName, ref DateTime? propertyValueHolder, DateTime? newValue)

Parameters

propertyName string
propertyValueHolder DateTime?
newValue DateTime?

Returns

bool

SetPropertyValue(string, ref decimal?, decimal?)

protected bool SetPropertyValue(string propertyName, ref decimal? propertyValueHolder, decimal? newValue)

Parameters

propertyName string
propertyValueHolder decimal?
newValue decimal?

Returns

bool

SetPropertyValue(string, ref double?, double?)

protected bool SetPropertyValue(string propertyName, ref double? propertyValueHolder, double? newValue)

Parameters

propertyName string
propertyValueHolder double?
newValue double?

Returns

bool

SetPropertyValue(string, ref Guid?, Guid?)

protected bool SetPropertyValue(string propertyName, ref Guid? propertyValueHolder, Guid? newValue)

Parameters

propertyName string
propertyValueHolder Guid?
newValue Guid?

Returns

bool

SetPropertyValue(string, ref int?, int?)

protected bool SetPropertyValue(string propertyName, ref int? propertyValueHolder, int? newValue)

Parameters

propertyName string
propertyValueHolder int?
newValue int?

Returns

bool

SetPropertyValue(string, ref long?, long?)

protected bool SetPropertyValue(string propertyName, ref long? propertyValueHolder, long? newValue)

Parameters

propertyName string
propertyValueHolder long?
newValue long?

Returns

bool

SetPropertyValue(string, object)

protected bool SetPropertyValue(string propertyName, object newValue)

Parameters

propertyName string
newValue object

Returns

bool

SetPropertyValue(string, ref string, string)

protected bool SetPropertyValue(string propertyName, ref string propertyValueHolder, string newValue)

Parameters

propertyName string
propertyValueHolder string
newValue string

Returns

bool

SetPropertyValue<T>(string, T)

protected bool SetPropertyValue<T>(string propertyName, T newValue)

Parameters

propertyName string
newValue T

Returns

bool

Type Parameters

T

SetPropertyValue<T>(string, ref T, T)

protected bool SetPropertyValue<T>(string propertyName, ref T propertyValueHolder, T newValue)

Parameters

propertyName string
propertyValueHolder T
newValue T

Returns

bool

Type Parameters

T

ThrowObjectDisposedException()

protected virtual void ThrowObjectDisposedException()

ToString()

Returns a string which represents the current object.

public override string ToString()

Returns

string

A string value which represents the current PersistentBase object.

TriggerObjectChanged(ObjectChangeEventArgs)

protected virtual void TriggerObjectChanged(ObjectChangeEventArgs args)

Parameters

args ObjectChangeEventArgs

Operators

operator ==(CriteriaOperator, PersistentBase)

public static BinaryOperator operator ==(CriteriaOperator prop, PersistentBase obj)

Parameters

prop CriteriaOperator
obj PersistentBase

Returns

BinaryOperator

operator !=(CriteriaOperator, PersistentBase)

public static BinaryOperator operator !=(CriteriaOperator prop, PersistentBase obj)

Parameters

prop CriteriaOperator
obj PersistentBase

Returns

BinaryOperator