Skip to content

Instantly share code, notes, and snippets.

View xhafan's full-sized avatar
🤠

Martin Havlišta xhafan

🤠
View GitHub Profile
@xhafan
xhafan / SomeClassMappingOverrides.cs
Last active January 3, 2020 06:05
NHibernate, Fluent.NHibernate and PostgreSql: How to map string property into PostgreSql json type using Fluent.NHibernate and IUserType
public class SomeClassMappingOverrides : IAutoMappingOverride<SomeClass>
{
public void Override(AutoMapping<SygicPoi> mapping)
{
mapping.Map(x => x.Json).CustomSqlType("json").CustomType<StringAsJson>(); // Json property type is string
}
}