diff options
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/EntityJsonHelper.cs | 7 |
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) |