In version 3.2 of NHibernate a new mapping capabilities was introduced to easy mapping of entities in your project. To understand how it works and how easy it is here it is all initialization code you need if you want to accept default mapping rules for all of your classes. Basically I’m creating a ConvetionModelMapper [...]
I’ve already blogged in the past on how to easily troubleshoot WCF Exception and that suggestion is valid for every exception you encounter in WCF. Today I have a function that gave the error System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. —> [...]
When you work with ORM like nhibernate, having a tool like nhprof is the key of success. But even with NHProfiler you could not prevent people of doing wrong stuff because they do not use it . I have a simple scenario, a developer changed a method on the server lazily fetching a property of [...]
Continue reading about Unit test NHibernate query to verify N+1
Another advantage of storing properties of entities into a state object based on a Dictionary, is the ability to easily serialize objects in custom formats. As an example I create an XML serializer that is capable to serialize an entity in a custom XML format. I used this simple serializer to create a NHibernate User [...]
1: DateAdd(dd, T.AnalysisFrequence, :refdate) Quite often I use SQLite to create Unit Tests of NH queries with a fast In-Memory database, and then run the queries against a standard Sql Server database. Today I have this problem, an HQL query uses the DateAdd Sql Server function 1: DateDiff(dd, T.AnalysisFrequence, :refdate) In this query with the [...]
Continue reading about Use SQLite to test NH–DateAdd function


