public virtual void UpdateByProperties<TEntity>(TEntity entity, params Expression<Func<TEntity, object>>[] properties) where TEntity : class
{
var entry = this.Entry(entity);
foreach (var selector in properties)
{
entry.Property(selector).IsModified = true;
}
SaveChanges();
}