Skip to content

Commit f25e959

Browse files
committed
fix(数据库查询): 修改默认查询表达式以包含null检查
默认查询表达式现在会检查IsDeleted为null或false的情况,以修复可能遗漏未删除记录的bug
1 parent fb007c4 commit f25e959

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GameFrameX.DataBase.Mongo/MongoDbService.Query.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public sealed partial class MongoDbService
260260
/// <returns>默认的查询表达式。</returns>
261261
private static Expression<Func<TState, bool>> GetDefaultFindExpression<TState>(Expression<Func<TState, bool>> filter) where TState : BaseCacheState
262262
{
263-
Expression<Func<TState, bool>> expression = m => m.IsDeleted == false;
263+
Expression<Func<TState, bool>> expression = m => m.IsDeleted == null || m.IsDeleted == false;
264264
if (filter != null)
265265
{
266266
expression = expression.And(filter);

0 commit comments

Comments
 (0)