I'm using Orchard 1.6 and I'm creating parts for my module. The piece in my migration file that creates the specific table is:
// Creating table SessionInformationRecord
SchemaBuilder.CreateTable("SessionInformationRecord", table => table
.Column("Id", DbType.Int32, column => column.PrimaryKey().Identity())
.Column("TrackInformationRecord_Id", DbType.Int32)
.Column("Title", DbType.String, col => col.Unlimited())
.Column("Description", DbType.String, col => col.Unlimited())
.Column("StartDate", DbType.DateTime)
.Column("EndDate", DbType.DateTime)
.Column("HasEvaluation", DbType.Boolean)
.Column("IsDeleted", DbType.Boolean)
);
The Title and Description are supposed to be unlimited Strings. However, When I enter content for those fields that are beyond 4000 characters, I get this error:
{"@p1 : String truncation: max=4000, len=21588, value=''."}
Any other way to get around this? Or is 4000 characters the max for a String?
UPDATE:
Aside from the DB side, I read that you also have to handle it on the NHibernate side to make sure it doesn't truncate the string. People have told me to add the attribute:
[StringLengthMax]
However, my model only recognizes the [StringLength] attribute. What namespace or class do I need to import in order to use the [StringLengthMax] attribute?