public void SaveXML(tblConfigMain pConfigMain) { using (var ctx = new CentralConfigEntities()) { var configMainData = (ctx.tblConfigMains.Where( s => (pConfigMain != null && s.ConfigName == pConfigMain.ConfigName && s.ConfigNamespace == pConfigMain.ConfigNamespace))).FirstOrDefault(); if (pConfigMain.ConfigValue != null) if (configMainData != null) configMainData.ConfigValue = pConfigMain.ConfigValue; int num = ctx.SaveChanges(); } }
public CentralConfigManager() { _bitsdbContext = new CentralConfigEntities(); }