Hey, NHibernate give me back my milliseconds - Derik Whittaker - Devlicio.us - Just the Tasty Bits:

Have you ever noticed that out of the box NHibernate’s DateTime type will truncate/ignore your milliseconds for DateTime fields?

We had notes inserting into a system with date stamps, and occasionally they'd come back in SELECTs in a different order than they were inserted.  Um, that's why.

The easiest way to "fix" this, keeping in mind SQL Server's limitations with storing milliseconds, is to change our Fluent NHibernate mappings to use NHiberate's customtype TimeStamp.

Map(pn => pn.CreatedDateUtc).CustomType();

Hello, unintuitive.  Better is to make everything a DateTime2, but I think the NHibernate mapping still has to include CustomType.  Still testing that one.