Update some properties

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

Update some properties

上一篇:【CF163E】e-Government


下一篇:MyBatis