Skip to main content
.NET 6.0+

ModuleBase.GetModuleUpdaters(IObjectSpace, Version) Method

Returns the list of ModuleUpdater updaters that handle database updates for the ModuleBase module.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public virtual IEnumerable<ModuleUpdater> GetModuleUpdaters(
    IObjectSpace objectSpace,
    Version versionFromDB
)

Parameters

Name Type Description
objectSpace IObjectSpace

An IObjectSpace object which represents the Object Space used to update the database.

versionFromDB Version

A System.Version object which represents the current database version.

Returns

Type Description
IEnumerable<ModuleUpdater>

An IEnumerable<ModuleUpdater> list of updaters that handle database updates for the ModuleBase module.

Remarks

This method collects module updaters declared in the current module’s assembly via the reflection. In your custom module, you can override this method to explictly specify required module updaters and thus, avoid the use of reflection and improve performance. When you create a module updater class, register it in the overridden GetModuleUpdaters method.

public class MyModule : ModuleBase {
    // ...
    public override IEnumerable<ModuleUpdater> GetModuleUpdaters(
        IObjectSpace objectSpace, Version versionFromDB) {
        return new ModuleUpdater[] { new Updater(objectSpace, versionFromDB) };
    }
}

This code is already added to a module template. Change it if you need to register extra module updater classes. If your custom module is not supposed to provide any updates to the database, then override the method as follows.

public override IEnumerable<ModuleUpdater> GetModuleUpdaters(
    IObjectSpace objectSpace, Version versionFromDB) {
     return ModuleUpdater.EmptyModuleUpdaters;
}
See Also