diff options
author | crupest <crupest@outlook.com> | 2022-12-06 11:14:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:52 +0800 |
commit | 58d109a1cde88ee9614852ef301f2a8be359cc1c (patch) | |
tree | b33df5481aa9ea36e9236976725e64d00e05327f /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | |
parent | 3d55a8a37e0e56e56a0bdad4fbb7a69a5d36d54b (diff) | |
download | crupest-58d109a1cde88ee9614852ef301f2a8be359cc1c.tar.gz crupest-58d109a1cde88ee9614852ef301f2a8be359cc1c.tar.bz2 crupest-58d109a1cde88ee9614852ef301f2a8be359cc1c.zip |
Develop secret api. v11
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | 8 |
1 files changed, 8 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 f6bbb12..b7f74e6 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs @@ -62,4 +62,12 @@ public class CrudService<TEntity> var sql = _table.GenerateSelectSql(where, orderBy, skip, limit, out parameters); return await connection.QueryAsync<TEntity>(sql, parameters); } + + public virtual async Task<int> UpdateAsync(WhereClause? where, UpdateClause update) + { + var connection = await EnsureDatabase(); + DynamicParameters parameters; + var sql = _table.GenerateUpdateSql(where, update, out parameters); + return await connection.ExecuteAsync(sql, parameters); + } } |