예제 #1
0
 public void Add(T record)
 {
     using (var context = new teCorpContext())
     {
         context.Entry(record).State = EntityState.Added;
         context.SaveChanges();
     }
 }
예제 #2
0
 public void Remove(T record)
 {
     using (var context = new teCorpContext())
     {
         context.Entry(record).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
예제 #3
0
 public void Update(T record)
 {
     using (var context = new teCorpContext())
     {
         context.Entry(record).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
예제 #4
0
 public void RemoveRange(List <T> records)
 {
     using (var context = new teCorpContext())
     {
         foreach (var record in records)
         {
             context.Entry(record).State = EntityState.Deleted;
         }
         context.SaveChanges();
     }
 }