diff options
author | crupest <crupest@outlook.com> | 2022-12-10 16:56:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | f208e75f9e074a3faab489de1093f660b87c2ec7 (patch) | |
tree | 2c2379c5155b7cef31c56c6559418ce1d66128a5 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | |
parent | 8c478bb1a07a55b9056ada029e0d6f9fe34d8d38 (diff) | |
download | crupest-f208e75f9e074a3faab489de1093f660b87c2ec7.tar.gz crupest-f208e75f9e074a3faab489de1093f660b87c2ec7.tar.bz2 crupest-f208e75f9e074a3faab489de1093f660b87c2ec7.zip |
Develop secret api. v24
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs index e098aca..811b2e6 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs @@ -40,6 +40,16 @@ public class CrudService<TEntity> : IDisposable where TEntity : class return _table.Select(_dbConnection, filter).Cast<TEntity>().ToList(); } + public bool Exists(IWhereClause? filter) + { + return _table.SelectCount(_dbConnection, filter) > 0; + } + + public int Count(IWhereClause? filter) + { + return _table.SelectCount(_dbConnection, filter); + } + public int Insert(IInsertClause insertClause) { return _table.Insert(_dbConnection, insertClause); |