示例#1
0
 public void Update(T entity)
 {
     using (ERPEntities entities = new ERPEntities())
     {
         entities.Entry(entity).State = EntityState.Modified;
         entities.SaveChanges();
     }
 }
示例#2
0
 public void Delete(T entity)
 {
     using (ERPEntities entities = new ERPEntities())
     {
         entities.Entry(entity).State = EntityState.Deleted;
         entities.SaveChanges();
     }
 }
示例#3
0
 public void Insert(T entity)
 {
     using (ERPEntities entities = new ERPEntities())
     {
         entities.Set <T>().Add(entity);
         entities.SaveChanges();
     }
 }