예제 #1
0
        public void Add(object enumItemObject)
        {
            Ethnicitys enumItem = (Ethnicitys)enumItemObject;

            using (var dbContext = new MedialynxDbEthnicitysContext()) {
                dbContext.Ethnicitys.Add(enumItem);
                dbContext.SaveChanges();
            }
        }
예제 #2
0
 public void Update(Ethnicitys enumItem)
 {
     using (var dbContext = new MedialynxDbEthnicitysContext()) {
         var existsItem = dbContext.Ethnicitys.FirstOrDefault(u => u != null && u.Id == enumItem.Id);
         if (existsItem != null)
         {
             if (Utils.CopyPropertyValues <Ethnicitys>(enumItem, existsItem))
             {
                 dbContext.Ethnicitys.Update(existsItem);
                 dbContext.SaveChanges();
             }
         }
     }
 }