public void Insert(TEntity entity)
 {
     using (var db = new MsSqlDbContext())
     {
         db.Set <TEntity>().Add(entity);
         db.SaveChanges();
     }
 }
 public void Update(TEntity entity)
 {
     using (var db = new MsSqlDbContext())
     {
         db.Entry(entity).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void Delete(TEntity entity)
 {
     using (var db = new MsSqlDbContext())
     {
         db.Set <TEntity>().Remove(entity);
         db.SaveChanges();
     }
 }