diff options
author | crupest <crupest@outlook.com> | 2022-12-05 20:28:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:52 +0800 |
commit | 3d55a8a37e0e56e56a0bdad4fbb7a69a5d36d54b (patch) | |
tree | 01b0098fd4cb3fb5ee05aa7434b51d9a7e084b0e /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | |
parent | db0932004e2d7462288044e4dd9c353d9b534793 (diff) | |
download | crupest-3d55a8a37e0e56e56a0bdad4fbb7a69a5d36d54b.tar.gz crupest-3d55a8a37e0e56e56a0bdad4fbb7a69a5d36d54b.tar.bz2 crupest-3d55a8a37e0e56e56a0bdad4fbb7a69a5d36d54b.zip |
Develop secret api. v10
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | 9 |
1 files changed, 9 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 acb05f8..f6bbb12 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs @@ -53,4 +53,13 @@ public class CrudService<TEntity> } return connection; } + + + public virtual async Task<IEnumerable<TEntity>> QueryAsync(WhereClause? where = null, OrderByClause? orderBy = null, int? skip = null, int? limit = null) + { + var connection = await EnsureDatabase(); + DynamicParameters parameters; + var sql = _table.GenerateSelectSql(where, orderBy, skip, limit, out parameters); + return await connection.QueryAsync<TEntity>(sql, parameters); + } } |