2

How can I mapping a string field length to the nvarchar(max) in sql server?

Property<string>(x => x.Content, x => x.Length(Int32.MaxValue));

It results in mapping to nvarchar(255) only.

lkurylo
  • 1,621
  • 33
  • 59

1 Answers1

3
Property(x => x.Content, x => x.Type(NHibernateUtil.StringClob))
Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154
  • Just to put my two cents here I leave another way to specify the length public class MyObjectMapper : ClassMapping { public MyObjectMapper() { Id(x => x.MyObjectId, mapper => mapper.Generator(Generators.GuidComb)); Property(x => x.Descripcion, mapper => mapper.Length(600)); } } – Matias Sep 01 '17 at 11:12