Skip to main content

XPClassInfo.CreateNewObject(Session) Method

Creates a new persistent object.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public virtual object CreateNewObject(
    Session session
)

Parameters

Name Type Description
session Session

A Session object which represents the session. This property is assigned to the object’s PersistentBase.Session property.

Returns

Type Description
Object

An object which is the newly created persistent object.

Remarks

After the CreateNewObject method creates an object, it is marked as “new”, to be inserted into the database later and its PersistentBase.AfterConstruction method is invoked.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateNewObject(Session) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also