diff options
author | crupest <crupest@outlook.com> | 2022-12-12 20:38:49 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | bc2a3db855cca16d4f66b23f814528671b5d8591 (patch) | |
tree | 8ff8b574c550e9df2dda8108a09a392636b54075 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | |
parent | d8f12e14f3cebd759a8ee911cabb9585063606cb (diff) | |
download | crupest-bc2a3db855cca16d4f66b23f814528671b5d8591.tar.gz crupest-bc2a3db855cca16d4f66b23f814528671b5d8591.tar.bz2 crupest-bc2a3db855cca16d4f66b23f814528671b5d8591.zip |
Develop secret api. v32
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs index 7944c18..5d73002 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs @@ -38,50 +38,4 @@ public class CrudService<TEntity> : IDisposable where TEntity : class { _dbConnection.Dispose(); } - - public List<TEntity> Select(IWhereClause? filter) - { - return _table.Select<TEntity>(_dbConnection, null, filter).ToList(); - } - - public bool Exists(IWhereClause? filter) - { - return _table.SelectCount(_dbConnection, filter) > 0; - } - - public int Count(IWhereClause? filter) - { - return _table.SelectCount(_dbConnection, filter); - } - - // Return the key. - public object Insert(IInsertClause insertClause) - { - return _table.Insert(_dbConnection, insertClause); - } - - public int Update(IUpdateClause updateClause, IWhereClause? filter) - { - return _table.Update(_dbConnection, filter, updateClause); - } - - public int Delete(IWhereClause? filter) - { - return _table.Delete(_dbConnection, filter); - } - - public TEntity SelectByKey(object key) - { - return Select(WhereClause.Create().Eq(_table.KeyColumn.ColumnName, key)).Single(); - } - - public List<JsonDocument> SelectAsJson(IWhereClause? filter) - { - return Select(filter).Select(e => _jsonHelper.ConvertEntityToJson(e)).ToList(); - } - - public JsonDocument SelectAsJsonByKey(object key) - { - return SelectAsJson(WhereClause.Create().Eq(_table.KeyColumn.ColumnName, key)).Single(); - } } |