From 5a149d626ae8bc3fa4bddbb53f8caf40f51f6da6 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周三, 04 6月 2025 17:42:13 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- Weben_CMS专用代码生成器/Code/Templete/EntityFrameworkCore/EfCoreRepository模板.txt | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/EntityFrameworkCore/EfCoreRepository\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/EntityFrameworkCore/EfCoreRepository\346\250\241\346\235\277.txt" index 39ea7e4..efb086b 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/EntityFrameworkCore/EfCoreRepository\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/EntityFrameworkCore/EfCoreRepository\346\250\241\346\235\277.txt" @@ -174,6 +174,7 @@ public async Task<List<$EntityName$>> GetListByFilterAsync(Expression<Func<$EntityName$, bool>> whereConditions, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) + .IncludeDetails() .WhereIf(whereConditions != null, whereConditions) .Where(x => !x.IsDeleted) .OrderByDescending(x => x.$OrderBy$) @@ -193,10 +194,11 @@ if (is鈥婱ultipleThrowException) { var entitys = await (await GetDbSetAsync()) - .WhereIf(whereConditions != null, whereConditions) - .Where(x => !x.IsDeleted) - .OrderByDescending(x => x.$OrderBy$) - .ToListAsync(GetCancellationToken(cancellationToken)); + .IncludeDetails() + .WhereIf(whereConditions != null, whereConditions) + .Where(x => !x.IsDeleted) + .OrderByDescending(x => x.$OrderBy$) + .ToListAsync(GetCancellationToken(cancellationToken)); if (entitys?.Count > 1) { throw new UserFriendlyException("鏌ヨ鍒板鏉¤褰�"); @@ -206,10 +208,11 @@ else { return await (await GetDbSetAsync()) - .WhereIf(whereConditions != null, whereConditions) - .Where(x => !x.IsDeleted) - .OrderByDescending(x => x.$OrderBy$) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + .IncludeDetails() + .WhereIf(whereConditions != null, whereConditions) + .Where(x => !x.IsDeleted) + .OrderByDescending(x => x.$OrderBy$) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } } -- Gitblit v1.9.3