CommonCRUDServiceTEntity, TKey, TInput, TFilter Class

通用 CRUD 服务泛型基类,过滤器类型为 CommonFilter 或从继承自 CommonFilter 的类型。

Definition

Namespace: QuickAdmin.Service.CRUD
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 2.0.13
C#
[NotUseDI]
public class CommonCRUDService<TEntity, TKey, TInput, TFilter> : CRUDServiceBase<TEntity, TKey, TInput, TFilter>, 
	ICRUDServiceProxy, ICRUDQueryOptionsProxy
where TEntity : class, object, IEntityWithIdKey<TKey>
where TInput : class
where TFilter : new(), CommonFilter
Inheritance
object    CRUDServiceBaseTEntity, TKey, TInput, TFilter    CommonCRUDServiceTEntity, TKey, TInput, TFilter
Derived
Implements
ICRUDQueryOptionsProxy, ICRUDServiceProxy

Type Parameters

TEntity
实体类型。
TKey
主键数据类型。
TInput
输入类型。
TFilter
过滤器类型。

Remarks

如果 TFilter 含有除过 CommonFilter 里的额外的过滤条件属性, 派生类需要重写 ApplyFilterAsync() 方法以确保能构造正确的过滤条件。

Constructors

CommonCRUDServiceTEntity, TKey, TInput, TFilter 初始化新实例。
CommonCRUDServiceTEntity, TKey, TInput, TFilter(IFreeSql) 使用指定的 IFreeSql 初始化新实例。

Properties

Public Properties

OPModule 获取本服务对应操作模块的名称。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterOPModule)
OPObject 获取本服务操作的对象的名称,即 TEntity 的显示名称。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterOPObject)

Protected Properties

AllowFilterValueStartsWithOperator 指示是否允许过滤条件值以比较运算符打头,如 "10""=10""==10" 均表示等于 10,">=10" 表示大于等于 10,"==" 则表示 "is null" 等等。
CategoryFilterPropertyName 获取 TEntity 中与 CommonFilterCategoryId 过滤条件对应的公共属性名称。
通常为当前实体的外键属性。
DateTimeFilterPropertyName 获取 TEntity 中与 CommonFilter 的时间过滤条件对应的公共属性名称。
DefaultOrderBys 获取默认排序字段。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterDefaultOrderBys)
DefaultSortListDescending 指示是否默认为降序排序。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterDefaultSortListDescending)
deptService 部门服务。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
EnableChangeLogging 指示在更新实体时,是否比对更改前后的记录并将有变更的字段值记入操作日志。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterEnableChangeLogging)
fsql 获取本服务要操作的数据所用的 IFreeSql 实例。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterfsql)
IDeleteObj 获取 IDelete 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
IncludePropertyNamesForISelect 获取一个字符串数组,指示在查询时要贪婪加载的属性。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterIncludePropertyNamesForISelect)
ISelectObj 获取 ISelect 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
IUpdateObj 获取 IUpdate 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
logger 系统日志。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
mapper 对象映射器。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
opLogService 操作日志服务。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
PopulateAuditorNamesInList 指示在查询实体列表时是否自动填充审计类实体中的操作用户姓名相关属性,如 CreatorNameUpdaterName 等。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterPopulateAuditorNamesInList)
TreatAsteriskInFilterValueAsStartsOrEndsWithOperator 获取/设置一个布尔值,指示是否将过滤条件值里打头或结尾的星号作为 StartsWith/EndsWith 运算符。
TreatEmptyFilterValueAsNull 指示是否将过滤条件空值按数据库空值处理。
userService 用户服务。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)

Methods

Public Methods

Add 添加实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AddAsync 添加实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkAdd 批量添加实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkAddAsync 批量添加实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkDelete 批量删除实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkDeleteAsync 批量删除实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkUpdate 批量更新实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
BulkUpdateAsync 批量更新实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Clone(TKey) 克隆指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Clone(TKey) 克隆实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
CloneAsync(TKey, CancellationToken) 克隆指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
CloneAsync(TKey, CancellationToken) 克隆实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Delete(TKey) 删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Delete(TKey) 删除实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
DeleteAsync(TKey, CancellationToken) 删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
DeleteAsync(TKey, CancellationToken) 删除实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
DeleteByFilter 删除指定过滤器代表的实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
DeleteByFilterAsync 删除指定过滤器代表的实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Exists 检测指定实体是否存在。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
ExistsAsync 检测指定实体是否存在。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Get 获取指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetAsync 获取指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetDtoPagingOutputTDto 执行查询,并返回指定页码的,把 TEntity 映射为 TDto 后的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetDtoPagingOutputAsyncTDto 执行查询,并返回指定页码的,把 TEntity 映射为 TDto 后的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetPagingOutput 执行查询,并返回指定页码的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetPagingOutputAsync 执行查询,并返回指定页码的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
MapFromInput 由实体输入构造实体对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
MapToInput 由实体对象构造实体输入。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawCount 按指定过滤条件查询记录数。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawCountAsync 按指定过滤条件查询记录数。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExists 直接检测指定实体是否存在。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExistsAsync 直接检测指定实体是否存在。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawGet 直接获取指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawGetAsync 直接获取指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawGetSpecificDataTReturn 查找指定实体,并返回指定类型的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawGetSpecificDataAsyncTReturn 查找指定实体,并返回指定类型的数据。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQuery 直接按指定过滤器查询实体列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQueryAsync(TFilter, CancellationToken) 直接按指定过滤器查询实体列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQueryAsync(TFilter, string, string, CancellationToken) 直接按指定过滤器查询实体列表。可指定排序。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQueryDtoTDto 查询并返回将 TEntity 映射为 TDto 后的数据列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQueryDtoAsyncTDto(ExpressionFuncTEntity, TDto, TFilter, FuncISelectTEntity, ISelectTEntity, CancellationToken) 查询并返回将 TEntity 映射为 TDto 后的数据列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawQueryDtoAsyncTDto(ExpressionFuncTEntity, TDto, TFilter, string, string, FuncISelectTEntity, ISelectTEntity, CancellationToken) 查询并返回将 TEntity 映射为 TDto 后的数据列表。可指定排序。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
Update 更新实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
UpdateAsync 更新实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)

Protected Methods

AddOperationLog 记录操作日志。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AddOperationLogAsync 记录操作日志。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterAdd 添加实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterAddAsync 添加实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterBulkAdd 批量添加实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterBulkAddAsync 批量添加实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterBulkDelete 批量删除实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterBulkDeleteAsync 批量删除实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterDelete 删除实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
AfterDeleteAsync 删除实体后要进行的操作。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
ApplyFilter 应用 CommonFilter 过滤器。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterApplyFilter(ISelectTEntity, TFilter))
ApplyFilterAsync 应用 CommonFilter 过滤器。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterApplyFilterAsync(ISelectTEntity, TFilter, CancellationToken))
CanDelete 用于在删除实体前检查该实体当前是否允许删除。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
CanDeleteAsync 用于在删除实体前检查该实体当前是否允许删除。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
CompareChanges 比对实体更新前后的变更,并返回变更描述。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
FetchList 由分页设置后的 ISelect 执行查询并获取实体列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
FetchListAsync 由分页设置后的 ISelect 执行查询并获取实体列表。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetBeginTimeExp 获取日期时间属性大于或等于指定起始时间的表达式。
GetEndTimeLessOrEqualExp 获取日期时间属性小于或等于指定结束时间的表达式。
GetEndTimeLessThanExp 获取日期时间属性小于指定结束时间的表达式。
GetFilteredIDelete 获取应用了指定过滤器的 IDelete 对象。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterGetFilteredIDelete(TFilter))
GetFilteredIDeleteAsync 获取应用了指定过滤器的 IDelete 对象。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterGetFilteredIDeleteAsync(TFilter, CancellationToken))
GetFilteredIUpdate 获取应用了指定过滤器的 IUpdate 对象。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterGetFilteredIUpdate(TFilter))
GetFilteredIUpdateAsync 获取应用了指定过滤器的 IUpdate 对象。
(Overrides CRUDServiceBaseTEntity, TKey, TInput, TFilterGetFilteredIUpdateAsync(TFilter, CancellationToken))
GetISelect(TKey) 获取选取了指定记录的 ISelect 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetISelect(PagingInputTFilter) 获取应用了分页输入参数内的过滤器、排序等等以及其它选项的 ISelect 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetISelectAsync 获取应用了分页输入参数内的过滤器、排序等等以及其它选项的 ISelect 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetIUpdate 获取用来更新指定实体的 IUpdate 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
GetIUpdateAsync 获取用来更新指定实体的 IUpdate 对象。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
OnBulkDelete 执行 SQL 语句,批量删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
OnBulkDeleteAsync 执行 SQL 语句,批量删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
OnDelete 执行 SQL 语句,删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
OnDeleteAsync 执行 SQL 语句,删除指定实体。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
ParseFilterItemValue 解析指定属性和它的值,以及值中可能包含的比较运算符。
PrepareNewEntity 预处理新实体。用于在添加实体时,按需对其进行一些额外的加工。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
PrepareNewEntityAsync 预处理新实体。用于在添加实体时,按需对其进行一些额外的加工。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExecuteInsert 执行插入实体 Insert 语句的方法。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExecuteInsertAsync 执行插入实体 Insert 语句的方法。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExecuteUpdate 执行更新实体 Update 语句的方法。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
RawExecuteUpdateAsync 执行更新实体 Update 语句的方法。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
SetCategoryFilter 设置类别过滤条件。
SetCategoryFilterAsync 设置类别过滤条件。
SetColumnFilter 用指定属性及其值设置过滤条件。
SetOrderBy 设置排序。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
ValidateInput 用于在添加或更新实体时,校验输入是否有效。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)
ValidateInputAsync 用于在添加或更新实体时,校验输入是否有效。
(Inherited from CRUDServiceBaseTEntity, TKey, TInput, TFilter)

Explicit Interface Implementations

ICRUDQueryOptionsProxyAllowFilterValueStartsWithOperatorProxyAllowFilterValueStartsWithOperator 代理属性。
ICRUDQueryOptionsProxyCategoryFilterPropertyNameProxyCategoryFilterPropertyName 代理属性。
ICRUDQueryOptionsProxyDateTimeFilterPropertyNameProxyDateTimeFilterPropertyName 代理属性。
ICRUDQueryOptionsProxyDefaultOrderBysProxyDefaultOrderBys 代理属性。
ICRUDQueryOptionsProxyDefaultSortListDescendingProxyDefaultSortListDescending 代理属性。
ICRUDQueryOptionsProxyEnableChangeLoggingProxyEnableChangeLogging 代理属性。
ICRUDQueryOptionsProxyIncludePropertyNamesForISelectProxyIncludePropertyNamesForISelect 代理属性。
ICRUDQueryOptionsProxyPopulateAuditorNamesInListProxyPopulateAuditorNamesInList 代理属性。
ICRUDQueryOptionsProxyTreatAsteriskInFilterValueAsStartsOrEndsWithOperatorProxyTreatAsteriskInFilterValueAsStartsOrEndsWithOperator 代理属性。
ICRUDQueryOptionsProxyTreatEmptyFilterValueAsNullProxyTreatEmptyFilterValueAsNull 代理属性。
ICRUDServiceProxyAddProxyAsync 添加实体的代理方法。
ICRUDServiceProxyCloneProxyAsync(object, CancellationToken) 克隆指定实体的代理方法。
ICRUDServiceProxyCloneProxyAsync(object, CancellationToken) 克隆实体的代理方法。
ICRUDServiceProxyDeleteByFilterProxyAsync 删除指定过滤器代表的实体的代理方法。
ICRUDServiceProxyDeleteProxyAsync(object, CancellationToken) 删除实体的代理方法。
ICRUDServiceProxyDeleteProxyAsync(object, CancellationToken) 删除实体的代理方法。
ICRUDServiceProxyGetISelectThatAppliedFilterAsync 获取已应用过滤器的 ISelect 对象的代理方法。
ICRUDServiceProxyGetPagingOutputProxyAsync 执行分页查询的代理方法。
ICRUDServiceProxyMapFromInputProxy 由实体输入构造实体对象的代理方法。
ICRUDServiceProxyMapToInputProxy 由实体对象构造实体输入的代理方法。
ICRUDServiceProxyOPModuleProxyOPModule 代理属性。
ICRUDServiceProxyOPObjectProxyOPObject 代理属性。
ICRUDServiceProxyRawGetProxyAsync 直接获取实体的代理方法。
ICRUDServiceProxyUpdateProxyAsync 更新实体的代理方法。

See Also