NHibernate Queries with Values Produced by Business Logic
        Posted  
        
            by Lewis
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Lewis
        
        
        
        Published on 2010-04-22T22:00:40Z
        Indexed on 
            2010/04/22
            22:03 UTC
        
        
        Read the original article
        Hit count: 218
        
nhibernate
|domain-driven-design
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.
© Stack Overflow or respective owner