Automatically truncating strings in NHibernate / SQL Server

前端 未结 1 326
忘了有多久
忘了有多久 2021-01-13 14:30

I have a nvarchar(2000) column in a SQL Server 2005 database, and have mapped this into NHibernate as:



        
1条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 15:06

    Create a custom User Type and which truncates the string if it's longer than 2000 chars. Here is sample of creating User Type

    
    

    0 讨论(0)
提交回复
热议问题