FileSystemCommandProcessor.Execute(FileSystemCommand, IDictionary<String, Object>) Method

Executes a command.

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public FileSystemCommandResult Execute(
    FileSystemCommand command,
    IDictionary<string, object> arguments
)

Parameters

Name Type Description
command FileSystemCommand

The command.

arguments IDictionary<String, Object>

The command arguments.

Returns

Type Description
FileSystemCommandResult

The command result.

Remarks

The arguments parameter contains information that depends on a file operation:

For example:

  • delete command - the parameter contains information about the deleted item.

  • rename command - the parameter contains information about the renamed item.

Arguments come as an encoded string in JSON format.

The following example illustrates how to create a method that handles the File Manager operations.

API Controller:

public class FileManagerApiController : Controller {
    public object FileSystem(FileSystemCommand command, string arguments) {
        var parsedArguments = JsonConvert.DeserializeObject<IDictionary<string, object>>(arguments);
  `     var result = processor.Execute(command, parsedArguments);
        //...
    }
}

Concepts

Online Demo

Online Example

See Also