Example #1
0
        public void Delete(T entity)
        {
            PCBangEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Deleted;
            context.SaveChanges();
        }
Example #2
0
        public void Update(T entity)
        {
            PCBangEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Modified;
            context.SaveChanges();
        }
Example #3
0
        public void Insert(T entity)
        {
            PCBangEntities context = CreateContext();

            context.Entry(entity).State = EntityState.Added;
            context.SaveChanges();
        }
Example #4
0
        public void Update(List <T> entities)
        {
            PCBangEntities context = CreateContext();

            context.Entry(entities).State = EntityState.Modified;

/*            foreach (var entity in entities)
 *              context.Entry(entity).State = EntityState.Modified;*/
            context.SaveChanges();
        }