public app_config GetAppConfig(long id) { using (CIDEntities dbContext = new CIDEntities()) { app_config entity = dbContext.app_config.FirstOrDefault(row => row.id == id); return(entity); } }
public bool UpdateAppConfig(string name, string value) { bool result = true; using (CIDEntities dbContext = new CIDEntities()) { try { app_config entity = dbContext.app_config.FirstOrDefault(row => row.name == name); entity.value = value; dbContext.SaveChanges(); } catch (Exception) { string.Format("unable to retrieve app_config by name: {0}", name); } } return(result); }