aboutsummaryrefslogtreecommitdiff
path: root/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-12-14 16:07:16 +0800
committercrupest <crupest@outlook.com>2022-12-20 20:32:53 +0800
commit70662b4da01a2daa2ece586e5ba6e78bb7a7eb4d (patch)
treea77e4c618eece790f7b7f746699f2e2aa5151e71 /docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs
parent94d39ea715ae81ef93e1bc289762b7500db197f9 (diff)
downloadcrupest-70662b4da01a2daa2ece586e5ba6e78bb7a7eb4d.tar.gz
crupest-70662b4da01a2daa2ece586e5ba6e78bb7a7eb4d.tar.bz2
crupest-70662b4da01a2daa2ece586e5ba6e78bb7a7eb4d.zip
Develop secret api. v39
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs')
-rw-r--r--docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs
index 497c086..1e484ef 100644
--- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs
@@ -23,10 +23,11 @@ public class EntityJsonHelper<TEntity> where TEntity : class
{
var result = new Dictionary<string, object?>();
- foreach (var propertyInfo in _table.ColumnProperties)
+ foreach (var column in _table.PropertyColumns)
{
- var value = propertyInfo.GetValue(entity);
- result[propertyInfo.Name] = value;
+ var value = column.PropertyInfo!.GetValue(entity);
+ var realValue = column.ColumnType.ConvertToDatabase(value);
+ result[column.ColumnName] = realValue;
}
if (includeNonColumnProperties)