public bool CreateNewPrdt([FromBody] List <PrdtModel> NewPrdts) //int HeaderId, [FromBody]List<BomFormatDetail> Dtls { string str = @"Update Prdt set {1} Where prd_no = '{0}'"; List <SqlCommand> defaultValueCmds = new List <SqlCommand>(); if (BomService.DefaultPrdtSection.Count > 0) { foreach (PrdtModel item in NewPrdts) { List <string> setters = new List <string>(); foreach (var item2 in BomService.DefaultPrdtSection) { setters.Add("{0} = '{1}'".FormatOrg(item2.Key, GetDefaultVariable(item2.Value))); } defaultValueCmds.Add(new SqlCommand(str.FormatOrg(item.prd_no, string.Join(",", setters)))); } } var result = Service.CreateNewPrdt(NewPrdts, defaultValueCmds); return(result); }