From 3589d2c2b7148723b4414aa8a89a2cbfeb1dbca8 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 12 Dec 2022 20:38:49 +0800 Subject: Develop secret api. v32 --- .../CrupestApi.Commons/Crud/CrudService.cs | 46 ---------------------- 1 file changed, 46 deletions(-) (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs') 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 : IDisposable where TEntity : class { _dbConnection.Dispose(); } - - public List Select(IWhereClause? filter) - { - return _table.Select(_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 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(); - } } -- cgit v1.2.3