public IActionResult CreateSetting([FromBody] List <SettingModel> Item) { if (Item == null) { return(BadRequest("Invalid parameter")); } var isinserted = new List <bool>(); var stopwatch = StopwatchLogger.Start(_log); _log.Info("Called SettingsController CreateSettings"); try { //if (string.IsNullOrEmpty(Item.Content)) // return BadRequest("Invalid parameter."); //if (Convert.ToString(Item.Context) == "") // return BadRequest("Invalid parameter"); foreach (var item in Item) { // var CehckduplicatesettingByContext = _iSettingManager.GetSettings(TenantCode)?.Where(w => w.Context == item.Context).FirstOrDefault(); // if (CehckduplicatesettingByContext != null) // { // return BadRequest(string.Format("Duplicate context, please try with different context!, ")); // } isinserted.Add(_iSettingManager.CreateSetting(TenantCode, Mapfield(item))); } stopwatch.StopAndLog("CreateSetting method of SettingController"); return(Ok(isinserted.Contains(false) ? HttpStatusCode.ExpectationFailed : HttpStatusCode.OK)); } catch (Exception ex) { _log.Error(ExceptionFormatter.SerializeToString(ex)); return(StatusCode((int)HttpStatusCode.InternalServerError, ApiConstant.CustomErrorMessage)); } }