diff --git a/ZR.Repository/BaseRepository.cs b/ZR.Repository/BaseRepository.cs
index 5dceae3..f19a0b0 100644
--- a/ZR.Repository/BaseRepository.cs
+++ b/ZR.Repository/BaseRepository.cs
@@ -131,6 +131,13 @@ namespace ZR.Repository
return Context.Updateable(entity).UpdateColumns(expression).IgnoreColumns(ignoreAllNull).ExecuteCommand();
}
+ ///
+ /// 根据实体类更新 eg:Update(dept, it => new { it.Status }, f => depts.Contains(f.DeptId));只更新Status列,条件是包含
+ ///
+ ///
+ ///
+ ///
+ ///
public int Update(T entity, Expression> expression, Expression> where)
{
return Context.Updateable(entity).UpdateColumns(expression).Where(where).ExecuteCommand();
@@ -169,6 +176,13 @@ namespace ZR.Repository
// });
// return result.IsSuccess;
//}
+
+ ///
+ /// 更新指定列 eg:Update(w => w.NoticeId == model.NoticeId, it => new SysNotice(){ Update_time = DateTime.Now, Title = "通知标题" });
+ ///
+ ///
+ ///
+ ///
public int Update(Expression> where, Expression> columns)
{
return Context.Updateable().SetColumns(columns).Where(where).RemoveDataCache().ExecuteCommand();
diff --git a/ZR.Service/BaseService.cs b/ZR.Service/BaseService.cs
index 9c109fc..bf3e927 100644
--- a/ZR.Service/BaseService.cs
+++ b/ZR.Service/BaseService.cs
@@ -132,6 +132,13 @@ namespace ZR.Service
return baseRepository.Update(entity, expression, ignoreAllNull);
}
+ ///
+ /// 根据实体类更新 eg:Update(dept, it => new { it.Status }, f => depts.Contains(f.DeptId));只更新Status列,条件是包含
+ ///
+ ///
+ ///
+ ///
+ ///
public int Update(T entity, Expression> expression, Expression> where)
{
return baseRepository.Update(entity, expression, where);
@@ -171,6 +178,13 @@ namespace ZR.Service
// });
// return result.IsSuccess;
//}
+
+ ///
+ /// 更新指定列 eg:Update(w => w.NoticeId == model.NoticeId, it => new SysNotice(){ Update_time = DateTime.Now, Title = "通知标题" });
+ ///
+ ///
+ ///
+ ///
public int Update(Expression> where, Expression> columns)
{
return baseRepository.Update(where, columns);