示例#1
0
        public async Task <IActionResult> Delete(ModuleSourceDeleteModel model)
        {
            var command       = new ModuleSourceRemoveCommand(model.Id, model.ConcurrencyToken);
            var commandResult = await _messageDispatcher.DispatchAsync(command);

            if (commandResult.IsSuccess)
            {
                return(RedirectToAction(nameof(Index)));
            }

            return(GetActionResult(commandResult, model));
        }
 public void Handle(ModuleSourceRemoveCommand command)
 {
     (Entity as FileSystemModuleSource)?.Dispose();
     MarkAsDeleted();
 }