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.v18.2.dll

Declaration

public virtual IEnumerable<ModuleUpdater> GetModuleUpdaters(
    IObjectSpace objectSpace,
    Version versionFromDB
)
Public Overridable Function GetModuleUpdaters(
    objectSpace As IObjectSpace,
    versionFromDB As Version
) As IEnumerable(Of ModuleUpdater)

Parameters

Type Name Description
IObjectSpace objectSpace

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

Version versionFromDB

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