-
Abstract Audit trails using NHibernate's event model often use the OnPreInsert and OnPreUpdate event listeners to change/ modify the state of the entity. Although It may work in some cases and is sometimes referred to as a solution, it should be noted the OnPreInsert and OnPreUpdate events are not...
-
Scenario You want to create an audit table so that changes to business entities are tracked with a timestamp. You want this do be done automatically by NHibernate. Options There are a number of ways of doing this, using IInterceptor or the NHibernate 2.0 Event model. As the event model is fairly new...
-
Let's take a look at the following code: public class TaxCalculator { public static readonly TaxCalculator NoTax = new TaxCalculator("No Tax", 0.0); public TaxCalculator() { } public TaxCalculator(String name, Double percentage) { this.Name = name; this.Percentage = percentage; } public...