From 9a8168790e0d6b8601b0f7f5557976358677eeb1 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 19 5月 2025 08:00:50 +0800
Subject: [PATCH] 22
---
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