Example #1
0
 public virtual void Delete(TEntity entityToDelete)
 {
     if (context.Entry(entityToDelete).State == EntityState.Detached)
     {
         dbSet.Attach(entityToDelete);
     }
     dbSet.Remove(entityToDelete);
 }
Example #2
0
 public virtual void Insert(TEntity entity)
 {
     context.Entry(entity).State = EntityState.Modified;
     dbSet.Add(entity);
 }