How to Specify Columntype in fluent nHibernate?
- by Bipul
I have a class CaptionItem
public class CaptionItem
{
public virtual int SystemId { get; set; }
public virtual int Version { get; set; }
protected internal virtual IDictionary<string, string> CaptionValues {get; private set;}
}
I am using following code for nHibernate mapping
Id(x => x.SystemId);
Version(x => x.Version);
Cache.ReadWrite().IncludeAll();
HasMany(x => x.CaptionValues)
.KeyColumn("CaptionItem_Id")
.AsMap<string>(idx => idx.Column("CaptionSet_Name"), elem => elem.Column("Text"))
.Not.LazyLoad()
.Cascade.Delete()
.Table("CaptionValue")
.Cache.ReadWrite().IncludeAll();
So in database two tables get created. One CaptionValue and other CaptionItem. In CaptionItem table has three columns
1. CaptionItem_Id int
2. Text nvarchar(255)
3. CaptionSet_Name nvarchar(255)
Now, my question is how can I make the columnt type of Text to nvarchar(max)?
Thanks in advance.