Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BaseObjectSpace.CreateObject(Type) Method

Creates an object of the specified type.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public virtual object CreateObject(
    Type objectType
)

#Parameters

Name Type Description
objectType Type

A Type object which is the type of the object to be created.

#Returns

Type Description
Object

A created object of the specified type.

#Remarks

This method calls a protected virtual method, CreateObjectCore, which must be overridden in the BaseObjectSpace class descendants. After an object of the specified type is created, the BaseObjectSpace.SetModified method is called so that the created object is marked as modified, and therefore, is saved to the database during the next changes commit (see BaseObjectSpace.CommitChanges).

Use this method to create objects in Controllers. In a regular business class, create objects directly via their constructor.

#Implements

See Also