Изменения документа Сценарии
Редактировал(а) Alexandr Fokin 2024/12/07 13:48
<
>
отредактировано Alexandr Fokin
на 2024/04/13 14:39
на 2024/04/13 14:39
отредактировано Alexandr Fokin
на 2024/04/13 14:37
на 2024/04/13 14:37
Изменить комментарий:
К данной версии нет комментариев
Комментарий
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -12,24 +12,23 @@ 12 12 |(% style="width:117px" %)Отчистка JsonDocument|(% style="width:1238px" %)1) Вызываем Dispose в setter для предыдущего значения. 13 13 2) Делаем сущность Disposable и строим отчистку через Dispose DbContext. 14 14 |(% style="width:117px" %)Проблема форматирования|(% style="width:1238px" %)((( 15 -|( % style="width:151px" %) |(% style="width:1002px" %)(((15 +|((( 16 16 Проблема указания параметров форматирования, с которыми будет выполняться чтение и запись json столбца. 17 17 18 18 Serialization options for System.Text.Json support 19 19 [[https:~~/~~/github.com/npgsql/efcore.pg/issues/1107>>https://github.com/npgsql/efcore.pg/issues/1107]] 20 20 )))| 21 -| (% style="width:151px" %) |(% style="width:1002px" %)XO.EntityFrameworkCore.NpgsqlJsonSerializerOptions21 +|XO.EntityFrameworkCore.NpgsqlJsonSerializerOptions 22 22 [[https:~~/~~/www.nuget.org/packages/XO.EntityFrameworkCore.NpgsqlJsonSerializerOptions/>>https://www.nuget.org/packages/XO.EntityFrameworkCore.NpgsqlJsonSerializerOptions/]]| 23 -|(% style="width:151px" %)Простое решение|(% style="width:1002px" %)Реализовать кастомный {{code language="c#"}}ValueConverter<JsonElement, string>{{/code}}, определив в нем {{code language="c#"}}JsonSerializerOptions{{/code}}| 24 -|(% style="width:151px" %)Решение через маппинг ADO|(% style="width:1002px" %)((( 25 -NpgsqlConnection.GlobalTypeMapper.Mappings 26 -[[https:~~/~~/github.com/npgsql/efcore.pg/issues/1107#issuecomment-552182608>>https://github.com/npgsql/efcore.pg/issues/1107#issuecomment-552182608]] 23 +|Простое решение - реализовать кастомный {{code language="c#"}}ValueConverter<JsonElement, string>{{/code}}, определив в нем {{code language="c#"}}JsonSerializerOptions{{/code}}| 24 +| 27 27 26 +{{{NpgsqlConnection.GlobalTypeMapper.Mappings 28 28 6.0.0 29 -[[https:~~/~~/github.com/npgsql/efcore.pg/issues/1107#issuecomment-945126627>>https://github.com/npgsql/efcore.pg/issues/1107#issuecomment-945126627]] 28 + 29 +}}} 30 30 ))) 31 31 ))) 32 -))) 33 33 |(% style="width:141px" %)Parameters|(% style="width:1372px" %){{code language="c#"}}public static class QueryParameterExtensions 34 34 { 35 35 public static NpgsqlParameter StructToDbParameter<T>(