I just copied some outdated code to a new project with latest libs and writing of NTS geometries to PostgreSQL no longer works. Anyone has a hint for me?
DB setup is done as follows:
var db = PostgreSQLConfiguration.PostgreSQL83;
return db
.ConnectionString(connectionstring)
.AdoNetBatchSize(20)
.Dialect<NHibernate.Spatial.Dialect.PostGis30Dialect>();
The geometry is mapped as follows:
Map(x => x.Geom).CustomType<PostGisGeometryType>();
The error is the following:
System.InvalidCastException: Writing values of 'NetTopologySuite.Geometries.Point' is not supported for parameters having NpgsqlDbType 'Bytea'.
at Npgsql.Internal.AdoSerializerHelpers.<GetTypeInfoForWriting>g__ThrowWritingNotSupported|1_0(Type type, PgSerializerOptions options, Nullable`1 pgTypeId, Nullable`1 npgsqlDbType, Exception inner)
at Npgsql.Internal.AdoSerializerHelpers.GetTypeInfoForWriting(Type type, Nullable`1 pgTypeId, PgSerializerOptions options, Nullable`1 npgsqlDbType)
Cheers, Martin