Skip to main content
.NET Framework 4.5.2+

BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType Field

Certain Object Space methods have the Type parameters. This static field indicates whether these methods throw the ArgumentException when a passed type is not registered in the Object Space Provider’s entity store. Set this field to true to diagnose issues related to the incorrect use of the Object Space type (for example, when a persistent Object Space is used to manipulate non-persistent objects).

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v23.1.dll

NuGet Package: DevExpress.ExpressApp


public static bool ThrowExceptionForNotRegisteredEntityType

Field Value

Type Description

true, if Object Space methods that have the Type parameters throw the ArgumentException when a passed type is not registered in the Object Space Provider’s entity store; otherwise, false.


You can specify this static field in one of the following locations:

  • in the constructor of your platform-agnostic module located in the Module.cs (Module.vb) file;
  • in the constructor of your application located in the WinApplication.cs (WinApplication.vb) or WebApplication.cs (WebApplication.vb) file;
  • in the Main method of the WinForms application located in the Program.cs (Program.vb) file, before the WinApplication.Start call;
  • in the Application_Start method of the ASP.NET Web Forms application located in the Global.asax.cs (Global.asax.vb) file, before the WebApplication.Start call.

The following example shows how to specify this field in a WinForms application.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win;
// ...
public partial class MySolutionWindowsFormsApplication : WinApplication {
    static MySolutionWin() {
        BaseObjectSpace.ThrowExceptionForNotRegisteredEntityType = true;
        // ...
    // ...

The following code snippets (auto-collected from DevExpress Examples) contain references to the ThrowExceptionForNotRegisteredEntityType field.


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