diff options
author | crupest <crupest@outlook.com> | 2022-12-06 11:58:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:52 +0800 |
commit | a389635f5b6e1c6033e3dec80816370d396c39c8 (patch) | |
tree | 7c43ccfb134a2fc82bacb95d4b365419981632e6 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs | |
parent | bb9a81e03d0b20dcea9b75e5145dee11f87d910e (diff) | |
download | crupest-a389635f5b6e1c6033e3dec80816370d396c39c8.tar.gz crupest-a389635f5b6e1c6033e3dec80816370d396c39c8.tar.bz2 crupest-a389635f5b6e1c6033e3dec80816370d396c39c8.zip |
Develop secret api. v13
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 b7f74e6..bbd5e9a 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudService.cs @@ -63,6 +63,14 @@ public class CrudService<TEntity> return await connection.QueryAsync<TEntity>(sql, parameters); } + public virtual async Task<int> InsertAsync(InsertClause insert) + { + var connection = await EnsureDatabase(); + DynamicParameters parameters; + var sql = _table.GenerateInsertSql(insert, out parameters); + return await connection.ExecuteAsync(sql, parameters); + } + public virtual async Task<int> UpdateAsync(WhereClause? where, UpdateClause update) { var connection = await EnsureDatabase(); |