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();
}
相关文章
- 01-01一个不错的log4j.properties例子
- 01-015 -- Hibernate的基本用法 --4 2 hibernate.properties文件与hibernate.cfg.xml文件
- 01-01Git本地分支版本号过低导致的push错误 error: failed to push some refs to ... 及兴许amend
- 01-01uriworkermap.properties配置
- 01-01请确保在编译时已将“AjaxControlToolkit.Properties.Resources.NET4.resources”正确嵌入或链接到程序集“AjaxControlToolkit”
- 01-01Hashtable和Properties
- 01-01INSERT 中ON DUPLICATE KEY UPDATE的使用
- 01-01报错:Duplicate keys detected: ‘0‘. This may cause an update error. (key值不唯一问题)
- 01-01关于sql中ON DUPLICATE KEY UPDATE的使用
- 01-01仓库储存,存在添加减少,不存在插入ON DUPLICATE KEY UPDATE