refactor: ♻️ iSelect 扩展方法
[skip ci]
Before Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 207 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 28 KiB |
@ -50,11 +50,7 @@ public abstract class RepositoryService<TEntity, TPrimary, TLogger>(BasicReposit
|
||||
Func<QueryReq<TQuery>, ISelect<TEntity>> selector, QueryReq<TQuery> query, string fileName, Expression<Func<TEntity, object>> listExp = null)
|
||||
where TQuery : DataAbstraction, new()
|
||||
{
|
||||
var select = selector(query)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(Numbers.MAX_LIMIT_EXPORT);
|
||||
var select = selector(query).WithNoLockNoWait().Take(Numbers.MAX_LIMIT_EXPORT);
|
||||
|
||||
object list = listExp == null ? await select.ToListAsync().ConfigureAwait(false) : await select.ToListAsync(listExp).ConfigureAwait(false);
|
||||
|
||||
|
@ -28,11 +28,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
|
||||
public Task<long> CountAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -54,11 +50,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -80,14 +72,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
|
||||
public async Task<PagedQueryRsp<QueryExampleRsp>> PagedQueryAsync(PagedQueryReq<QueryExampleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryExampleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryExampleRsp>>());
|
||||
}
|
||||
@ -96,13 +81,7 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
|
||||
public async Task<IEnumerable<QueryExampleRsp>> QueryAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryExampleRsp>>();
|
||||
}
|
||||
|
||||
|
@ -28,11 +28,7 @@ public record Sys_LoginLog : SimpleEntity, IFieldCreatedTime, IFieldOwner, IFiel
|
||||
/// <summary>
|
||||
/// 创建者客户端用户代理
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)]
|
||||
#else
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[CsvIgnore]
|
||||
[JsonIgnore]
|
||||
public virtual string CreatedUserAgent { get; init; }
|
||||
|
@ -18,11 +18,7 @@ public record Sys_RequestLogDetail : SimpleEntity, IFieldCreatedTime, IFieldCrea
|
||||
/// <summary>
|
||||
/// 创建者客户端用户代理
|
||||
/// </summary>
|
||||
#if DBTYPE_SQLSERVER
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_1022)]
|
||||
#else
|
||||
[Column(Position = -1, DbType = Chars.FLG_DB_FIELD_TYPE_VARCHAR_255)]
|
||||
#endif
|
||||
[CsvIgnore]
|
||||
[JsonIgnore]
|
||||
public virtual string CreatedUserAgent { get; init; }
|
||||
|
@ -0,0 +1,94 @@
|
||||
namespace NetAdmin.Infrastructure.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// ISelect 扩展方法
|
||||
/// </summary>
|
||||
public static class ISelectExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1> WithNoLockNoWait<T1>(this ISelect<T1> me)
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1, T2> WithNoLockNoWait<T1, T2>(this ISelect<T1, T2> me)
|
||||
where T2 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1, T2, T3> WithNoLockNoWait<T1, T2, T3>(this ISelect<T1, T2, T3> me)
|
||||
where T2 : class //
|
||||
where T3 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1, T2, T3, T4> WithNoLockNoWait<T1, T2, T3, T4>(this ISelect<T1, T2, T3, T4> me)
|
||||
where T2 : class //
|
||||
where T3 : class //
|
||||
where T4 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1, T2, T3, T4, T5> WithNoLockNoWait<T1, T2, T3, T4, T5>(this ISelect<T1, T2, T3, T4, T5> me)
|
||||
where T2 : class //
|
||||
where T3 : class //
|
||||
where T4 : class //
|
||||
where T5 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 无锁无等待
|
||||
/// </summary>
|
||||
public static ISelect<T1, T2, T3, T4, T5, T6> WithNoLockNoWait<T1, T2, T3, T4, T5, T6>(this ISelect<T1, T2, T3, T4, T5, T6> me)
|
||||
where T2 : class //
|
||||
where T3 : class //
|
||||
where T4 : class //
|
||||
where T5 : class //
|
||||
where T6 : class
|
||||
{
|
||||
return me
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
}
|
@ -21,11 +21,7 @@ public sealed class ApiService(
|
||||
public Task<long> CountAsync(QueryReq<QueryApiReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -46,11 +42,7 @@ public sealed class ApiService(
|
||||
public Task<bool> ExistAsync(QueryReq<QueryApiReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -25,11 +25,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
|
||||
public Task<long> CountAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -64,11 +60,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
|
||||
public Task<bool> ExistAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -97,14 +89,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
|
||||
public async Task<PagedQueryRsp<QueryConfigRsp>> PagedQueryAsync(PagedQueryReq<QueryConfigReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryConfigRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryConfigRsp>>());
|
||||
}
|
||||
@ -113,13 +98,7 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
|
||||
public async Task<IEnumerable<QueryConfigRsp>> QueryAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryConfigRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
|
||||
public Task<long> CountAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -80,11 +76,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -113,12 +105,7 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
|
||||
public async Task<IEnumerable<QueryDeptRsp>> QueryAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return (await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.ToTreeListAsync()
|
||||
.ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>();
|
||||
return (await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false)).Adapt<IEnumerable<QueryDeptRsp>>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -25,11 +25,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public Task<long> CountAsync(QueryReq<QueryDicCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -37,12 +33,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public async Task<QueryDicCatalogRsp> CreateAsync(CreateDicCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
|
||||
@ -63,12 +54,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public async Task<int> EditAsync(EditDicCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
|
||||
? await UpdateAsync(req, null).ConfigureAwait(false)
|
||||
: throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
@ -77,11 +63,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -103,14 +85,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public async Task<PagedQueryRsp<QueryDicCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDicCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryDicCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicCatalogRsp>>());
|
||||
}
|
||||
@ -119,12 +94,7 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
public async Task<IEnumerable<QueryDicCatalogRsp>> QueryAsync(QueryReq<QueryDicCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.ToTreeListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryDicCatalogRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public Task<long> CountAsync(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -37,13 +33,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public async Task<QueryDicContentRsp> CreateAsync(CreateDicContentReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (!await Rpo.Orm.Select<Sys_DicCatalog>()
|
||||
.Where(a => a.Id == req.CatalogId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (!await Rpo.Orm.Select<Sys_DicCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.字典目录不存在);
|
||||
}
|
||||
|
||||
@ -63,13 +53,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public async Task<QueryDicContentRsp> EditAsync(EditDicContentReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (!await Rpo.Orm.Select<Sys_DicCatalog>()
|
||||
.Where(a => a.Id == req.CatalogId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (!await Rpo.Orm.Select<Sys_DicCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.字典目录不存在);
|
||||
}
|
||||
|
||||
@ -86,11 +70,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -112,14 +92,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public async Task<PagedQueryRsp<QueryDicContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryDicContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDicContentRsp>>());
|
||||
}
|
||||
@ -128,13 +101,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public async Task<IEnumerable<QueryDicContentRsp>> QueryAsync(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryDicContentRsp>>();
|
||||
}
|
||||
|
||||
@ -142,9 +109,7 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
public async Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode)
|
||||
{
|
||||
var ret = await Rpo.Orm.Select<Sys_DicContent>()
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Include(a => a.Catalog)
|
||||
.Where(a => a.Catalog.Code == catalogCode)
|
||||
.Where(a => a.Enabled)
|
||||
|
@ -25,11 +25,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public Task<long> CountAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -37,12 +33,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public async Task<QueryDocCatalogRsp> CreateAsync(CreateDocCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
|
||||
@ -63,12 +54,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public async Task<int> EditAsync(EditDocCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
|
||||
? await UpdateAsync(req, null).ConfigureAwait(false)
|
||||
: throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
@ -77,11 +63,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -103,14 +85,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public async Task<PagedQueryRsp<QueryDocCatalogRsp>> PagedQueryAsync(PagedQueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryDocCatalogRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocCatalogRsp>>());
|
||||
}
|
||||
@ -119,12 +94,7 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
public async Task<IEnumerable<QueryDocCatalogRsp>> QueryAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.ToTreeListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryDocCatalogRsp>>();
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
using NetAdmin.Domain.Dto.Sys.Doc.Content;
|
||||
using NetAdmin.Domain.Enums.Sys;
|
||||
#if !DBTYPE_SQLSERVER
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
#endif
|
||||
|
||||
namespace NetAdmin.SysComponent.Application.Services.Sys;
|
||||
|
||||
@ -27,11 +29,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public Task<long> CountAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -39,13 +37,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public async Task<QueryDocContentRsp> CreateAsync(CreateDocContentReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (!await Rpo.Orm.Select<Sys_DocCatalog>()
|
||||
.Where(a => a.Id == req.CatalogId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (!await Rpo.Orm.Select<Sys_DocCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.文档分类不存在);
|
||||
}
|
||||
|
||||
@ -65,13 +57,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public async Task<QueryDocContentRsp> EditAsync(EditDocContentReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (!await Rpo.Orm.Select<Sys_DocCatalog>()
|
||||
.Where(a => a.Id == req.CatalogId)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
if (!await Rpo.Orm.Select<Sys_DocCatalog>().Where(a => a.Id == req.CatalogId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.文档分类不存在);
|
||||
}
|
||||
|
||||
@ -88,11 +74,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -114,14 +96,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public async Task<PagedQueryRsp<QueryDocContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryDocContentRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryDocContentRsp>>());
|
||||
}
|
||||
@ -130,13 +105,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
public async Task<IEnumerable<QueryDocContentRsp>> QueryAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryDocContentRsp>>();
|
||||
}
|
||||
|
||||
|
@ -26,11 +26,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
public Task<long> CountAsync(QueryReq<QueryJobRecordReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -52,11 +48,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobRecordReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -80,9 +72,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
req.ThrowIfInvalid();
|
||||
|
||||
var ret = await QueryInternal(req with { Order = Orders.None })
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour })
|
||||
.ToListAsync(a => new GetBarChartRsp {
|
||||
Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0
|
||||
@ -98,9 +88,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req with { Order = Orders.None })
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Include(a => a.Job)
|
||||
.GroupBy(a => a.HttpStatusCode)
|
||||
#pragma warning disable CA1305
|
||||
@ -115,9 +103,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req with { Order = Orders.None })
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Include(a => a.Job)
|
||||
.GroupBy(a => a.Job.JobName)
|
||||
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key })
|
||||
@ -129,14 +115,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
public async Task<PagedQueryRsp<QueryJobRecordRsp>> PagedQueryAsync(PagedQueryReq<QueryJobRecordReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryJobRecordRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRecordRsp>>());
|
||||
}
|
||||
@ -145,13 +124,7 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
public async Task<IEnumerable<QueryJobRecordRsp>> QueryAsync(QueryReq<QueryJobRecordReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryJobRecordRsp>>();
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
public Task<long> CountAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -129,11 +125,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -192,9 +184,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
]
|
||||
};
|
||||
var job = await QueryInternal(new QueryReq<QueryJobReq> { DynamicFilter = df, Order = Orders.Random }, false)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Where(a => !Rpo.Orm.Select<Sys_JobRecord>().As("b").Where(b => b.JobId == a.Id && b.TimeId == a.NextTimeId).Any())
|
||||
.ToOneAsync(a => new {
|
||||
a.RequestUrl
|
||||
@ -262,14 +252,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
public async Task<PagedQueryRsp<QueryJobRsp>> PagedQueryAsync(PagedQueryReq<QueryJobReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryJobRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryJobRsp>>());
|
||||
}
|
||||
@ -285,13 +268,7 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
public async Task<IEnumerable<QueryJobRsp>> QueryAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryJobRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
|
||||
public Task<long> CountAsync(QueryReq<QueryLoginLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
|
||||
public Task<bool> ExistAsync(QueryReq<QueryLoginLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -80,9 +72,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
|
||||
var list = await QueryInternal(req)
|
||||
.Include(a => a.Owner)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Count(out var total)
|
||||
.ToListAsync(a => new {
|
||||
a.CreatedClientIp
|
||||
@ -106,13 +96,7 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
|
||||
public async Task<IEnumerable<QueryLoginLogRsp>> QueryAsync(QueryReq<QueryLoginLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryLoginLogRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
|
||||
public Task<long> CountAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -64,11 +60,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
|
||||
public Task<bool> ExistAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -97,12 +89,7 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
|
||||
public async Task<IEnumerable<QueryMenuRsp>> QueryAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.ToTreeListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().ToTreeListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryMenuRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
|
||||
public Task<long> CountAsync(QueryReq<QueryRequestLogDetailReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogDetailReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -79,14 +71,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
|
||||
public async Task<PagedQueryRsp<QueryRequestLogDetailRsp>> PagedQueryAsync(PagedQueryReq<QueryRequestLogDetailReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryRequestLogDetailRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRequestLogDetailRsp>>());
|
||||
}
|
||||
@ -95,13 +80,7 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
|
||||
public async Task<IEnumerable<QueryRequestLogDetailRsp>> QueryAsync(QueryReq<QueryRequestLogDetailReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryRequestLogDetailRsp>>();
|
||||
}
|
||||
|
||||
|
@ -27,11 +27,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
public Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -59,11 +55,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -109,9 +101,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
req.ThrowIfInvalid();
|
||||
|
||||
var ret = await QueryInternal(req with { Order = Orders.None }, false)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.GroupBy(a => new { a.CreatedTime.Year, a.CreatedTime.Month, a.CreatedTime.Day, a.CreatedTime.Hour })
|
||||
.ToListAsync(a => new GetBarChartRsp {
|
||||
Timestamp = new DateTime(a.Key.Year, a.Key.Month, a.Key.Day, a.Key.Hour, 0, 0
|
||||
@ -127,9 +117,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req with { Order = Orders.None })
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.GroupBy(a => a.Api.Summary)
|
||||
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key })
|
||||
.ConfigureAwait(false);
|
||||
@ -141,9 +129,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req with { Order = Orders.None }, false)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.GroupBy(a => a.HttpStatusCode)
|
||||
#pragma warning disable CA1305
|
||||
.ToListAsync(a => new GetPieChartRsp { Value = a.Count(), Key = a.Key.ToString() })
|
||||
@ -171,9 +157,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
}
|
||||
|
||||
var ret = await selectTemp.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Count(out var total)
|
||||
.ToListAsync(a => a.temp)
|
||||
.ConfigureAwait(false);
|
||||
@ -185,13 +169,7 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
public async Task<IEnumerable<QueryRequestLogRsp>> QueryAsync(QueryReq<QueryRequestLogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryRequestLogRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
public Task<long> CountAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -52,12 +48,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
public async Task<int> DeleteAsync(DelReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return await Rpo.Orm.Select<Sys_UserRole>()
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync(a => a.RoleId == req.Id)
|
||||
.ConfigureAwait(false)
|
||||
return await Rpo.Orm.Select<Sys_UserRole>().WithNoLockNoWait().AnyAsync(a => a.RoleId == req.Id).ConfigureAwait(false)
|
||||
? throw new NetAdminInvalidOperationException(Ln.该角色下存在用户)
|
||||
: await Rpo.DeleteAsync(a => a.Id == req.Id).ConfigureAwait(false);
|
||||
}
|
||||
@ -79,11 +70,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -105,14 +92,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
public async Task<PagedQueryRsp<QueryRoleRsp>> PagedQueryAsync(PagedQueryReq<QueryRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryRoleRsp>>());
|
||||
}
|
||||
@ -121,12 +101,7 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
public async Task<IEnumerable<QueryRoleRsp>> QueryAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryRoleRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
|
||||
public Task<long> CountAsync(QueryReq<QuerySiteMsgDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -77,14 +69,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
|
||||
public async Task<PagedQueryRsp<QuerySiteMsgDeptRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QuerySiteMsgDeptRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>());
|
||||
}
|
||||
@ -93,13 +78,7 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
|
||||
public async Task<IEnumerable<QuerySiteMsgDeptRsp>> QueryAsync(QueryReq<QuerySiteMsgDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QuerySiteMsgDeptRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
|
||||
public Task<long> CountAsync(QueryReq<QuerySiteMsgFlagReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgFlagReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -77,14 +69,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
|
||||
public async Task<PagedQueryRsp<QuerySiteMsgFlagRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgFlagReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QuerySiteMsgFlagRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>());
|
||||
}
|
||||
@ -93,13 +78,7 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
|
||||
public async Task<IEnumerable<QuerySiteMsgFlagRsp>> QueryAsync(QueryReq<QuerySiteMsgFlagReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QuerySiteMsgFlagRsp>>();
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
|
||||
public Task<long> CountAsync(QueryReq<QuerySiteMsgRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -77,14 +69,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
|
||||
public async Task<PagedQueryRsp<QuerySiteMsgRoleRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QuerySiteMsgRoleRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>());
|
||||
}
|
||||
@ -93,13 +78,7 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
|
||||
public async Task<IEnumerable<QuerySiteMsgRoleRsp>> QueryAsync(QueryReq<QuerySiteMsgRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QuerySiteMsgRoleRsp>>();
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
public Task<long> CountAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -94,11 +90,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -143,9 +135,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Count(out var total)
|
||||
.ToListAsync(a => new {
|
||||
a.CreatedTime
|
||||
@ -172,13 +162,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
public async Task<IEnumerable<QuerySiteMsgRsp>> QueryAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QuerySiteMsgRsp>>();
|
||||
}
|
||||
|
||||
@ -295,9 +279,7 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
var roleIds = contextUserInfo.Roles.Select(x => x.Id).ToList();
|
||||
|
||||
return Rpo.Orm.Select<Sys_SiteMsg, Sys_User, Sys_SiteMsgDept, Sys_SiteMsgRole, Sys_SiteMsgUser, Sys_SiteMsgFlag>()
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.LeftJoin((a, b, _, _, _, _) => a.CreatedUserId == b.Id)
|
||||
.LeftJoin((a, _, c, _, _, _) => a.Id == c.SiteMsgId)
|
||||
.LeftJoin((a, _, _, d, _, _) => a.Id == d.SiteMsgId)
|
||||
|
@ -25,11 +25,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
|
||||
public Task<long> CountAsync(QueryReq<QuerySiteMsgUserReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -51,11 +47,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgUserReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -77,14 +69,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
|
||||
public async Task<PagedQueryRsp<QuerySiteMsgUserRsp>> PagedQueryAsync(PagedQueryReq<QuerySiteMsgUserReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QuerySiteMsgUserRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QuerySiteMsgUserRsp>>());
|
||||
}
|
||||
@ -93,13 +78,7 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
|
||||
public async Task<IEnumerable<QuerySiteMsgUserRsp>> QueryAsync(QueryReq<QuerySiteMsgUserReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QuerySiteMsgUserRsp>>();
|
||||
}
|
||||
|
||||
|
@ -44,11 +44,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
public Task<long> CountAsync(QueryReq<QueryUserProfileReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -78,11 +74,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
public Task<bool> ExistAsync(QueryReq<QueryUserProfileReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -113,9 +105,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Count(out var total)
|
||||
.ToListAsync((a, b, c, d, e) => new {
|
||||
a
|
||||
@ -141,9 +131,7 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Take(req.Count)
|
||||
.ToListAsync((a, b, c, d, e) => new {
|
||||
a
|
||||
|
@ -68,11 +68,7 @@ public sealed class UserService(
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
#pragma warning disable VSTHRD103
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
#pragma warning restore VSTHRD103
|
||||
}
|
||||
|
||||
@ -235,9 +231,7 @@ public sealed class UserService(
|
||||
var includeRoles = listUserExp == _listUserExp;
|
||||
var select = await QueryInternalAsync(req, includeRoles).ConfigureAwait(false);
|
||||
IEnumerable<Sys_User> list = await select.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Count(out var total)
|
||||
.ToListAsync(listUserExp)
|
||||
.ConfigureAwait(false);
|
||||
@ -252,12 +246,11 @@ public sealed class UserService(
|
||||
public async Task<IEnumerable<QueryUserRsp>> QueryAsync(QueryReq<QueryUserReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await (await QueryInternalAsync(req, false).ConfigureAwait(false))
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
var list = await (await QueryInternalAsync(req, false).ConfigureAwait(false)).WithNoLockNoWait()
|
||||
.Take(req.Count)
|
||||
.ToListAsync(a => new Sys_User { Id = a.Id, UserName = a.UserName })
|
||||
.ToListAsync(a => new Sys_User {
|
||||
Id = a.Id, UserName = a.UserName
|
||||
})
|
||||
.ConfigureAwait(false);
|
||||
return list.Adapt<IEnumerable<QueryUserRsp>>();
|
||||
}
|
||||
@ -418,63 +411,29 @@ public sealed class UserService(
|
||||
/// <inheritdoc />
|
||||
public async Task<UserInfoRsp> UserInfoAsync()
|
||||
{
|
||||
static void OtherIncludes(ISelect<Sys_Role> select)
|
||||
{
|
||||
select.Where(a => a.Enabled)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.IncludeMany( //
|
||||
a => a.Menus
|
||||
#if DBTYPE_SQLSERVER
|
||||
#pragma warning disable SA1115
|
||||
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#pragma warning restore SA1115
|
||||
#endif
|
||||
#pragma warning disable SA1009, SA1111
|
||||
)
|
||||
#pragma warning restore SA1111, SA1009
|
||||
.IncludeMany( //
|
||||
a => a.Depts
|
||||
#if DBTYPE_SQLSERVER
|
||||
#pragma warning disable SA1115
|
||||
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#pragma warning restore SA1115
|
||||
#endif
|
||||
#pragma warning disable SA1009, SA1111
|
||||
)
|
||||
#pragma warning restore SA1111, SA1009
|
||||
.IncludeMany( //
|
||||
a => a.Apis
|
||||
#if DBTYPE_SQLSERVER
|
||||
#pragma warning disable SA1115
|
||||
, then => then.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#pragma warning restore SA1115
|
||||
#endif
|
||||
#pragma warning disable SA1009, SA1111
|
||||
)
|
||||
#pragma warning restore SA1111, SA1009
|
||||
;
|
||||
}
|
||||
|
||||
var dbUser = await Rpo.Where(a => a.Token == UserToken.Token && a.Enabled)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Include(a => a.Dept)
|
||||
.IncludeMany(a => a.Roles, OtherIncludes)
|
||||
.ToOneAsync()
|
||||
.ConfigureAwait(false);
|
||||
return dbUser.Adapt<UserInfoRsp>();
|
||||
|
||||
static void OtherIncludes(ISelect<Sys_Role> select)
|
||||
{
|
||||
_ = select.Where(a => a.Enabled)
|
||||
.WithNoLockNoWait()
|
||||
.IncludeMany(a => a.Menus, then => then.WithNoLockNoWait())
|
||||
.IncludeMany(a => a.Depts, then => then.WithNoLockNoWait())
|
||||
.IncludeMany(a => a.Apis, then => then.WithNoLockNoWait());
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<Dictionary<long, string>> CreateEditCheckAsync(CreateEditUserReq req)
|
||||
{
|
||||
// 检查角色是否存在
|
||||
var roles = await Rpo.Orm.Select<Sys_Role>()
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.Where(a => req.RoleIds.Contains(a.Id))
|
||||
.ToDictionaryAsync(a => a.Id, a => a.DashboardLayout)
|
||||
.ConfigureAwait(false);
|
||||
@ -483,13 +442,7 @@ public sealed class UserService(
|
||||
}
|
||||
|
||||
// 检查部门是否存在
|
||||
var dept = await Rpo.Orm.Select<Sys_Dept>()
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Where(a => req.DeptId == a.Id)
|
||||
.ToListAsync(a => a.Id)
|
||||
.ConfigureAwait(false);
|
||||
var dept = await Rpo.Orm.Select<Sys_Dept>().WithNoLockNoWait().Where(a => req.DeptId == a.Id).ToListAsync(a => a.Id).ConfigureAwait(false);
|
||||
|
||||
return dept.Count != 1 ? throw new NetAdminInvalidOperationException(Ln.部门不存在) : roles;
|
||||
}
|
||||
|
@ -29,11 +29,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
public Task<long> CountAsync(QueryReq<QueryVerifyCodeReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.CountAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().CountAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -61,11 +57,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
public Task<bool> ExistAsync(QueryReq<QueryVerifyCodeReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.AnyAsync();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -87,14 +79,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
public async Task<PagedQueryRsp<QueryVerifyCodeRsp>> PagedQueryAsync(PagedQueryReq<QueryVerifyCodeReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var list = await QueryInternal(req)
|
||||
.Page(req.Page, req.PageSize)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Count(out var total)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var list = await QueryInternal(req).Page(req.Page, req.PageSize).WithNoLockNoWait().Count(out var total).ToListAsync().ConfigureAwait(false);
|
||||
|
||||
return new PagedQueryRsp<QueryVerifyCodeRsp>(req.Page, req.PageSize, total, list.Adapt<IEnumerable<QueryVerifyCodeRsp>>());
|
||||
}
|
||||
@ -103,13 +88,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
public async Task<IEnumerable<QueryVerifyCodeRsp>> QueryAsync(QueryReq<QueryVerifyCodeReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(req)
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.Take(req.Count)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
var ret = await QueryInternal(req).WithNoLockNoWait().Take(req.Count).ToListAsync().ConfigureAwait(false);
|
||||
return ret.Adapt<IEnumerable<QueryVerifyCodeRsp>>();
|
||||
}
|
||||
|
||||
@ -180,9 +159,7 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
, Value = destDevice
|
||||
}
|
||||
})
|
||||
#if DBTYPE_SQLSERVER
|
||||
.WithLock(SqlServerLock.NoLock | SqlServerLock.NoWait)
|
||||
#endif
|
||||
.WithNoLockNoWait()
|
||||
.ToOneAsync();
|
||||
}
|
||||
|
||||
|