/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
test-logs
src/Npgsql.NodaTime/NpgsqlNodaTimeExtensions.cs
32 строки
1 KB
Nino Floris
Remove obsolete UTF-8 BOMs (#6542)
13 апр 2026, 17:13
Не верифицирован
13 апр 2026, 17:13
5225216
Код
Авторство
О чём код?
using Npgsql.NodaTime.Internal; using Npgsql.TypeMapping; // ReSharper disable once CheckNamespace namespace Npgsql; /// <summary> /// Extension adding the NodaTime plugin to an Npgsql type mapper. /// </summary> public static class NpgsqlNodaTimeExtensions { // Note: defined for binary compatibility and NpgsqlConnection.GlobalTypeMapper. /// <summary> /// Sets up NodaTime mappings for the PostgreSQL date/time types. /// </summary> /// <param name="mapper">The type mapper to set up (global or connection-specific)</param> public static INpgsqlTypeMapper UseNodaTime(this INpgsqlTypeMapper mapper) { mapper.AddTypeInfoResolverFactory(new NodaTimeTypeInfoResolverFactory()); return mapper; } /// <summary> /// Sets up NodaTime mappings for the PostgreSQL date/time types. /// </summary> /// <param name="mapper">The type mapper to set up (global or connection-specific)</param> public static TMapper UseNodaTime<TMapper>(this TMapper mapper) where TMapper : INpgsqlTypeMapper { mapper.AddTypeInfoResolverFactory(new NodaTimeTypeInfoResolverFactory()); return mapper; } }