NHibernate Queries with Values Produced by Business Logic
- by Lewis
I have an NH query which returns a Product with a BasePrice. Depending on various other factors, such as Manufacturer price markup, I use a PricingService on the C# side of things to produce a "final" price.
The issue is that I now need to query against this final value - i.e., I need to run a query that selects Products within a particular "final" price range.
I'm thinking that my approach to this is all wrong, but I really didn't want to put the logic of the final price calculation in a SQL function or something like that, so any suggestions would be appreciated.