如何獲得流利的nhibernate在使用varbinary(max)字段大小的sql server 2005表中創建varbinary字段?目前,我總是得到varbinary(8000)的默認值,這個值不夠大,因爲我將要存儲圖像文件。如何獲得流利的nhibernate在sql server中創建varbinary(max)字段
我試過使用CAstle.ActiveRecord,但還沒有任何成功。
[ActiveRecord]
public class MyFile : Entity
{
public virtual string FileName { get; set; }
public virtual string FileType { get; set; }
public virtual int FileVersion { get; set; }
public virtual int FileLength { get; set; }
[Property(ColumnType = "BinaryBlob", SqlType = "VARBINARY(MAX)")]
public virtual byte[] FileData { get; set; }
}
去過事先未能在現在發現好幾個小時的解決方案,所以感謝
捷克克朗
`int.MaxValue`可能是更好的表達幻數的方式。如在`.Length(int.MaxValue)`中 – 2016-03-02 10:17:43