Auditing with NHibernate – Event Listeners

I’ve been doing some work on an application which needed to implement auditing. I wanted to make it as un-obtrusive as possible, basically being able to switch the auditing on and let the system record changes made to entities. Used in conjunction with a generic respository, I’ve got something which is *almost* there. I’m fairly…

Fluent Nhibernate PersistenceSpecification : failed: System.ApplicationException – Expected List but got IList

This had me puzzled for a while this afternoon so I thought I’d put this post up. I was trying to get an integration test running, checking to see that an object was being persisted correctly (against an im-memory SQLite database). The test was failing with “failed: System.ApplicationException” Expected List<> but got IList<> The problem…

Fluent NHibernate Object Referencing Instance of Itself / Self Referencing, Error “Repeated column in mapping for collection”

I came across a problem with a Schema Fluent Nhibernate was generating for me yesterday.  I was getting the error message “Repeated column in mapping for collection”. I had an object, let’s call it “Item” which referenced instances of the same type, let’s call them “AssociatedItems”. Thinking of a simple real-life example, when you do…