public async Task <IActionResult> Create([FromBody] SettingFormCommand command) { var spec = SettingFormSpecs.GetByNameSpec(command.Name); var isInvalid = await _settingFormRepository.ExistsAsync(spec); if (isInvalid) { throw new CellException("Setting form name mus be unique"); } var settingForm = command.To <SettingForm>(); _settingFormRepository.Add(new SettingForm( settingForm.Name, settingForm.Description, settingForm.LayoutId, JsonConvert.SerializeObject(command.Settings), settingForm.TableId, settingForm.TableName)); await _settingFormRepository.CommitAsync(); return(Ok()); }