Tuesday, April 19, 2016

SQLITE NHibernate DateTime2

While working on a project I was using a MsSQL 2012 database for my persistence layer but wanted to use a SQLITE in memory database for my unit/integration testing.  As part of my mapping setup I used an NHibernate Version column which used DateTime2:

NHibernate Mapping Code:

Unforntuently SQLITE doesn't support DateTime2. After searching around and not finding a good solution, I ended up extending SQLiteDialect class to map it to TEXT per the following link:   http://stackoverflow.com/a/16597386/2544235

SQLiteDialect Code:

Phoenix

I am resurrecting this tech blog for notes related to Azure Logic Apps with SAP.