Nvarchar(MAX) in Nhibernate

Default string length is 4000 for normal string type mapping in Nhibernate. To map  your mapping with a column of Nvarchar(max) you need to provide  length to mapping greater than 4000.

This number  will force Nhibernate to take mapping as NVarchar(Max).

Before

 

 Map(x => x.Body).Column("Body");
After
 Map(x => x.Body).Column("Body").Length(4001);
 
 
Keep Nhibernating Smile
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s