예제 #1
0
파일: DataAccess.cs 프로젝트: slitz/cid
 public app_config GetAppConfig(long id)
 {
     using (CIDEntities dbContext = new CIDEntities())
     {
         app_config entity = dbContext.app_config.FirstOrDefault(row => row.id == id);
         return(entity);
     }
 }
예제 #2
0
파일: DataAccess.cs 프로젝트: slitz/cid
        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);
        }