Skip to content

Commit 9d0b953

Browse files
committed
[修复]1. 修复查询数据的结果出现多条的报错处理
1 parent 3ed3b83 commit 9d0b953

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
@@ -59,7 +59,7 @@ public sealed partial class MongoDbService
5959
public async Task<TState> FindAsync<TState>(Expression<Func<TState, bool>> filter, bool isCreateIfNotExists = true) where TState : BaseCacheState, new()
6060
{
6161
var findExpression = GetDefaultFindExpression(filter);
62-
var state = await _mongoDbContext.Queryable<TState>().Where(findExpression).SingleOrDefaultAsync();
62+
var state = await _mongoDbContext.Queryable<TState>().Where(findExpression).FirstOrDefaultAsync();
6363

6464
if (!isCreateIfNotExists)
6565
{

0 commit comments

Comments
 (0)