Set column to NHibernate

I am looking at NHibernate mapping, and we are in a situation where we need to specify a mapping in a specific column. Preferably during display.

The idea is that after NHibernate creates the circuit, it will look something like this:

CREATE TABLE [dbo].[Foo] ( [Bar] NVARCHAR (128) NULL **collate sql_latin1_general_cp1_cs_as**, [BarTwo] NVARCHAR (max) ); 

I am currently using Fluent, but an xml solution will be fine.

+1
source share
1 answer

I found out that I can add a selection to CustomSqlType. This means that I always need to add CustomSqlType and therefore depend on the mapping database.

 .CustomSqlType("nvarchar(128) collate Latin1_General_CI_AS") 

But for now, it works. Does anyone have another / better idea / suggestion?

+2
source

Source: https://habr.com/ru/post/1387212/


All Articles