diff options
author | crupest <crupest@outlook.com> | 2022-12-13 11:37:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-20 20:32:53 +0800 |
commit | 72f0786810ec3afc7a7e42fdeb392717eeb1055b (patch) | |
tree | 6dab5ad8f920d6209bd4615f94287f070f2e2c57 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs | |
parent | f5e3d9959cfea707add5594cd195d33060cdb85c (diff) | |
download | crupest-72f0786810ec3afc7a7e42fdeb392717eeb1055b.tar.gz crupest-72f0786810ec3afc7a7e42fdeb392717eeb1055b.tar.bz2 crupest-72f0786810ec3afc7a7e42fdeb392717eeb1055b.zip |
Develop secret api. v35
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs index bbbbb4c..6119396 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs @@ -91,4 +91,10 @@ public class EntityJsonHelper<TEntity> where TEntity : class return result; } + + public TEntity ConvertJsonToEntityForInsert(string json) + { + var dictionary = JsonSerializer.Deserialize<Dictionary<string, object?>>(json, _jsonSerializerOptions)!; + return ConvertDictionaryToEntityForInsert(dictionary); + } } |