public async Task <IActionResult> Update([FromBody] SettingActionCommand command) { var settingAction = await _settingActionRepository.GetByIdAsync(command.Id); settingAction.Update( command.Code, command.Name, command.Description, command.ContainerType, JsonConvert.SerializeObject(command.Settings)); await _settingActionRepository.CommitAsync(); return(Ok()); }
public async Task <IActionResult> Create([FromBody] SettingActionCommand command) { var spec = SettingActionSpecs.GetByNameSpec(command.Name); var isInvalid = await _settingActionRepository.ExistsAsync(spec); if (isInvalid) { throw new CellException("Setting action name must be unique"); } _settingActionRepository.Add(new SettingAction( command.Code, command.Name, command.Description, command.ContainerType, JsonConvert.SerializeObject(command.Settings), command.TableId, command.TableName)); await _settingActionRepository.CommitAsync(); return(Ok()); }