public void Update(TEntity entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     else
     {
         ValueSettingHelper.SetUpdateValue <TEntity>(entity);
         Db.Entry(entity).State = EntityState.Modified;
         SaveChanges();
     }
 }
 public void Create(TEntity entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     else
     {
         ValueSettingHelper.SetCreateValue <TEntity>(entity);
         Db.Set <TEntity>().Add(entity);
         SaveChanges();
     }
 }