public async Task <IActionResult> UpdateCB(string keyNme, [FromBody] DTOs.ConfigItem configForUpdate) { var configFromRepo = await _configRepo.GetConfigByKeyAsync(keyNme); if (configFromRepo == null) { return(BadRequest()); } _configRepo.UpdateConfigItem(_mapper.Map(configForUpdate, configFromRepo)); return(Ok(_mapper.Map <DTOs.ConfigItem>(configFromRepo))); }
public IActionResult UpdateCB([FromBody] DTOs.ConfigItem configForUpdate) { configForUpdate.KeyNme = configForUpdate.KeyNme.ToUpper() + "_" + _env; var configFromRepo = _configRepo.GetConfigByKey(configForUpdate.KeyNme);// if (configFromRepo == null) { return(BadRequest()); } _configRepo.UpdateConfigItem(_mapper.Map(configForUpdate, configFromRepo)); return(Ok(_mapper.Map <DTOs.ConfigItem>(configFromRepo))); }