/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.1.15
src/Npgsql.RawPostgis/NpgsqlRawPostgisExtensions.cs
26 строк
912 B
Shay Rojansky
Minor cleanup all around
03 сен 2019, 12:26
03 сен 2019, 12:26
e59da52
Код
Авторство
О чём код?
using Npgsql.RawPostgis; using Npgsql.TypeMapping; using NpgsqlTypes; // ReSharper disable once CheckNamespace namespace Npgsql { /// <summary> /// Extension adding the legacy PostGIS types to an Npgsql type mapper. /// </summary> public static class NpgsqlRawPostgisExtensions { /// <summary> /// Sets up the legacy PostGIS types to an Npgsql type mapper. /// </summary> /// <param name="mapper">The type mapper to set up (global or connection-specific)</param> public static INpgsqlTypeMapper UseRawPostgis(this INpgsqlTypeMapper mapper) => mapper .AddMapping(new NpgsqlTypeMappingBuilder { PgTypeName = "geometry", NpgsqlDbType = NpgsqlDbType.Geometry, TypeHandlerFactory = new PostgisRawHandlerFactory() }.Build()); } }