Class ModuleImport
Represents a module that handles data import operations within a section.
Inherited Members
Namespace: DataWeb.Structure.Modules
Assembly: DataWeb.Core.dll
Syntax
public class ModuleImport : Module
Remarks
This class provides methods for validating and importing data associated with an item. It integrates with the form service to validate the data against predefined forms and ensures that the imported data adheres to the required format and rules.
Constructors
ModuleImport(Section, NavigationContext, IServiceProvider)
Represents a module that handles data import operations within a section.
Declaration
public ModuleImport(Section section, NavigationContext navigationContext, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
Section | section | |
NavigationContext | navigationContext | |
IServiceProvider | serviceProvider |
Remarks
This class provides methods for validating and importing data associated with an item. It integrates with the form service to validate the data against predefined forms and ensures that the imported data adheres to the required format and rules.
Methods
ImportAsync(Item, Dictionary<string, object>, CancellationToken)
Imports data for a specific item.
Declaration
public virtual Task<List<ValidationError>> ImportAsync(Item item, Dictionary<string, object> moduleData, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item for which the data is being imported. |
Dictionary<string, object> | moduleData | The data to import. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task<List<ValidationError>> | A task that represents the asynchronous operation. The task result contains a list of validation errors, if any occurred during the import process. |
ValidateImportDataAsync(Item, Dictionary<string, object>, CancellationToken)
Validates the data to be imported for a specific item.
Declaration
public virtual Task<List<ValidationError>> ValidateImportDataAsync(Item item, Dictionary<string, object> moduleData, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item for which the data is being validated. |
Dictionary<string, object> | moduleData | The data to validate before import. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task<List<ValidationError>> | A task that represents the asynchronous operation. The task result contains a list of validation errors. |