NHibernate How to specify custom sql type only in production

Posted by Davide Orazio Montersino on Stack Overflow See other posts from Stack Overflow or by Davide Orazio Montersino
Published on 2010-05-13T13:51:07Z Indexed on 2010/05/13 13:54 UTC
Read the original article Hit count: 265

I am saving binary files into a Sql Server 2005 Db using Fluent NHibernate. However, I am using SQLite to run my (pseudo) Unit Tests.

I need to use a custom Sql type for Ms Sql, but it would throw an error on SqlLite. What strategies can I use?

This is the Map file:

public class BinaryFile
 {   
 public BinaryFile()
    {         
        m.Map(x => x.BinaryData);//.CustomSqlType("varbinary(MAX)");
        m.Map(x => x.ContentType);
        m.Map(x => x.FileName);
        m.Map(x => x.FileSize);
    }
 }

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about mapping