Изменения документа Сценарии
Редактировал(а) Alexandr Fokin 2024/12/07 13:48
<
отредактировано Alexandr Fokin
на 2024/03/01 13:05
на 2024/03/01 13:05
отредактировано Alexandr Fokin
на 2024/12/07 13:48
на 2024/12/07 13:48
Изменить комментарий:
К данной версии нет комментариев
Комментарий
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -1,65 +1,23 @@ 1 -|(% style="width:141px" %) |(% style="width:1372px" %) 2 -|(% style="width:141px" %)[[JSON>>doc:Разработка.Схемы данных, контракты, форматы.Text.JSON.WebHome]] тип данных|(% style="width:1372px" %)((( 3 -|(% style="width:117px" %) |(% style="width:1238px" %)Can JSONB GIN indexes be specified in CodeFirst EntityFramework with NPGSQL? 4 -[[https:~~/~~/stackoverflow.com/questions/54618858/can-jsonb-gin-indexes-be-specified-in-codefirst-entityframework-with-npgsql>>https://stackoverflow.com/questions/54618858/can-jsonb-gin-indexes-be-specified-in-codefirst-entityframework-with-npgsql]] 5 -|(% style="width:117px" %)Тип столбца и свойства|(% style="width:1238px" %)((( 6 -JSON Mapping 7 -[[https:~~/~~/www.npgsql.org/efcore/mapping/json.html?tabs=data-annotations%2Cpoco>>https://www.npgsql.org/efcore/mapping/json.html?tabs=data-annotations%2Cpoco]] 1 +---- 8 8 9 -[[System. Text. Json>>doc:Разработка.NET.Библиотеки.Документы.Форматы данных и схемы.NET Json.System\. Text\. Json.WebHome]] 10 -Позволяет использовать JsonDocument и JsonElement. 11 -))) 12 -|(% style="width:117px" %)Отчистка JsonDocument|(% style="width:1238px" %)1) Вызываем Dispose в setter для предыдущего значения. 13 -2) Делаем сущность Disposable и строим отчистку через Dispose DbContext. 14 -|(% style="width:117px" %)Проблема форматирования|(% style="width:1238px" %)((( 15 -Проблема указания параметров форматирования, с которыми будет выполняться чтение и запись json столбца. 3 +==== Внутренние ссылки: ==== 16 16 17 -Serialization options for System.Text.Json support 18 -[[https:~~/~~/github.com/npgsql/efcore.pg/issues/1107>>https://github.com/npgsql/efcore.pg/issues/1107]] 19 -))) 20 -))) 21 -|(% style="width:141px" %)Parameters|(% style="width:1372px" %){{code language="c#"}}public static class QueryParameterExtensions 22 -{ 23 - public static NpgsqlParameter StructToDbParameter<T>( 24 - this T value, 25 - string name, 26 - NpgsqlDbType type 27 - ) 28 - where T : struct 29 - { 30 - return new NpgsqlParameter<T>(name, type) { TypedValue = value }; 31 - } 5 +====== Дочерние страницы: ====== 32 32 33 - public static NpgsqlParameter StructToDbParameter<T>( 34 - this T? value, 35 - string name, 36 - NpgsqlDbType type 37 - ) 38 - where T : struct 39 - { 40 - if (!value.HasValue) 41 - { 42 - return new NpgsqlParameter(name, type) { Value = DBNull.Value }; 43 - } 7 +{{children/}} 44 44 45 - return new NpgsqlParameter<T>(name, type) { TypedValue = value.Value }; 46 - } 9 +====== Обратные ссылки: ====== 47 47 48 - publicstatic NpgsqlParameter ClassToDbParameter<T>(49 - hisTvalue,50 - string name,51 - NpgsqlDbType type52 - 53 - whereT :class54 - {55 - if (value== null)56 - {57 - returnnew NpgsqlParameter(name, type) { Value = DBNull.Value };58 - 11 +{{velocity}} 12 +#set ($links = $doc.getBacklinks()) 13 +#if ($links.size() > 0) 14 + #foreach ($docname in $links) 15 + #set ($rdoc = $xwiki.getDocument($docname).getTranslatedDocument()) 16 + * [[$escapetool.xml($rdoc.fullName)]] 17 + #end 18 +#else 19 + No back links for this page! 20 +#end 21 +{{/velocity}} 59 59 60 - return new NpgsqlParameter<T>(name, type) { TypedValue = value }; 61 - } 62 -}{{/code}} 63 -|(% style="width:141px" %) |(% style="width:1372px" %) 64 - 65 - 23 +----