Mapping table and a simple view with Fluent NHibernate
- by adrin
I have mapped a simple entity, let's say an invoice using Fluent NHibernate, everything works fine... after a while it turns out that very frequently i need to process 'sent invoices' (by sent invoices we mean all entities that fulfill invoice.sent==true condition)... is there a way to easily abstract 'sent invoices' in terms of my data access layer? I dont like the idea of having aforementioned condition repeated in half of my repository methods.
I thought that using a simple filtering view would be optimal, but how could it be done?
Maybe I am doing it terribly wrong and someone would help me realize it :)?