Esempio n. 1
0
        public ICommandResult Handle(DeleteFlowCommand command)
        {
            ICommandResult result = new CommandResult();

            _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Debug, new { command.Flow, command.RequestHost }, "FlowCommandHandler.Handle(Delete)");

            try
            {
                if (_flowRepository.CheckExists(command.Flow))
                {
                    if (_flowRepository.Delete(command.Flow))
                    {
                        result = new CommandResult(200);
                    }
                }

                else if (_flowRepository.Valid)
                {
                    result = new CommandResult(400, new Notification("Flow", "Could not be found"));
                }
            }
            catch (Exception e)
            {
                _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Error, new { command.Flow, command.RequestHost }, e);
            }

            return(result);
        }
Esempio n. 2
0
 public void DeleteForm(string keyValue)
 {
     service.Delete(t => t.Id == keyValue);
 }