Class ModuleBase
Base class for modules that can be used to customize the behavior of an item's data form.
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public abstract class ModuleBase
Constructors
ModuleBase(Section, NavigationContext, IServiceProvider)
Constructor for creating a new instance of the ModuleBase class.
Declaration
public ModuleBase(Section section, NavigationContext navigationContext, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
Section | section | The section the module belongs to. |
NavigationContext | navigationContext | The navigation context. |
IServiceProvider | serviceProvider | The service provider used to retrieve other services. |
Fields
navigationContext
Declaration
protected readonly NavigationContext navigationContext
Field Value
Type | Description |
---|---|
NavigationContext |
section
Declaration
protected readonly Section section
Field Value
Type | Description |
---|---|
Section |
serviceProvider
Declaration
protected readonly IServiceProvider serviceProvider
Field Value
Type | Description |
---|---|
IServiceProvider |
Methods
CloneAsync(Item, Item)
Clones the provided item's module data to a new item.
Declaration
public virtual Task CloneAsync(Item item, Item itemCloned)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The original Item to clone from. |
Item | itemCloned | The new Item to clone to. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous clone operation. |
GetProvidedValues(Dictionary<string, object>)
Retrieves the provided values from the module data.
Declaration
public virtual List<Form.ProvidedValue> GetProvidedValues(Dictionary<string, object> moduleData)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, object> | moduleData | The module data containing the provided values. |
Returns
Type | Description |
---|---|
List<Form.ProvidedValue> | A list of Form.ProvidedValue objects. |
IsCompletedAsync(Item, Section)
Determines whether the provided item is completed for the current section.
Declaration
public virtual Task<bool> IsCompletedAsync(Item item, Section currentSection)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The Item being checked. |
Section | currentSection | The current Section being displayed. |
Returns
Type | Description |
---|---|
Task<bool> | A task that represents the asynchronous check operation. The result is a boolean indicating whether the item is completed. |
SaveAsync(Item, Dictionary<string, object>)
Saves the provided item data and module data.
Declaration
public virtual Task<ModuleSaveResult> SaveAsync(Item item, Dictionary<string, object> moduleData)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The Item being saved. |
Dictionary<string, object> | moduleData | The module data to be saved. |
Returns
Type | Description |
---|---|
Task<ModuleSaveResult> | A task that represents the asynchronous save operation. The result contains a ModuleSaveResult indicating whether the item was modified and which fields were modified, if any. |
ValidateAsync(Item, Dictionary<string, object>)
Validates the provided item data and module data.
Declaration
public virtual Task<List<ValidationError>> ValidateAsync(Item item, Dictionary<string, object> moduleData)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The Item being validated. |
Dictionary<string, object> | moduleData | The module data to be validated. |
Returns
Type | Description |
---|---|
Task<List<ValidationError>> | A task that represents the asynchronous validation operation. The result contains a list of validation errors, if any. |