/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v6.0.12
src/Npgsql.GeoJSON/NpgsqlGeoJSONExtensions.cs
23 строки
954 B
Shay Rojansky
Apply file-scoped namespaces for 6.0 (#4298)
28 янв 2022, 15:13
Не верифицирован
28 янв 2022, 15:13
2e0ad2d
Код
Авторство
О чём код?
using Npgsql.GeoJSON.Internal; using Npgsql.TypeMapping; // ReSharper disable once CheckNamespace namespace Npgsql; /// <summary> /// Extension allowing adding the GeoJSON plugin to an Npgsql type mapper. /// </summary> public static class NpgsqlGeoJSONExtensions { /// <summary> /// Sets up GeoJSON mappings for the PostGIS types. /// </summary> /// <param name="mapper">The type mapper to set up (global or connection-specific)</param> /// <param name="options">Options to use when constructing objects.</param> /// <param name="geographyAsDefault">Specifies that the geography type is used for mapping by default.</param> public static INpgsqlTypeMapper UseGeoJson(this INpgsqlTypeMapper mapper, GeoJSONOptions options = GeoJSONOptions.None, bool geographyAsDefault = false) { mapper.AddTypeResolverFactory(new GeoJSONTypeHandlerResolverFactory(options, geographyAsDefault)); return mapper; } }