roniburd,
I think filters would work great, but which layer do they belong in? If I put it in my Device class, doesn't that tie the domain layer to the data layer? I've never found an example of anyone putting nhibernate stuff in with their domain classes.
I guess if I explain my model a little better.....
I have web, data, service, and domain layers. The web layer calls static methods of the service classes (like DeviceService.GetAllDevices()), which in turn use a session (created at beginning of request and flushed at end) managed by the data layer and return collections of domain objects from the domain layer.
Can you recommend an example project that has good design that I can look at? I've been looking at the Cuyahoga project (
http://www.martijnboland.com/cuyahoga/).
Thanks for all your help so far.