Where should Nhibernate IPostInsertEventListener go in the 3 tier architecture
- by Quintin Par
I have a IPostInsertEventListener implementation like
public class NHibernateEventListener : IPostInsertEventListener, IPostUpdateEventListener
which catches some entity inserts and does an additional insert to another table for ETL.
Essentially it requires references to the Nhibernate, Domain entity and Repository<>
Now where do I go about adding this class? If I add it to ApplicationServices I’ll end up referencing Nhibernate at that layer. If I add this to the Data layer, I’ll have to reference Domain (circular).
How do I go implementing this class with S#arp principles? Any thoughts?