Thanks guys, I took a look at the linq-specifications code base on google
but it's not quite what I'm looking for.



What I want is to create concrete classes that are my specifications.  In a
billing system some examples may be:



LateChargesSpecification

ActiveCustomerSpecification

GoodCustomerDiscountSpecification



And I'd like these to be passed into an Account repository with a signature
like this:



public class MyRepo

{

  public IList<Account> SpecifiedBy(IList<ISpecification> specifications)

}



And a usage example could be:



var mySpecifications = new
IList<ISpecification>{ ActiveCustomerSpecification,
GoodCustomerDiscountSpecification
};





var activeCustomersWithDiscount = acctRepo.SpecifiedBy( mySpecifications );





I don't want any NHibernate specific dialect sprinkled at this level, but I
completely understand how my specifications will contain criteria or linq
predicates.



So guys, this is what I'm looking for, but I have no idea how to implement
it.  Again thanks for your help and I appreciate all your guidance.



 Thanks,

Sam

On Mon, May 10, 2010 at 12:37 PM, Fabio Maulo <[email protected]> wrote:

> If you don't have any problems to spam the NHibernate reference everywhere
> you can use Criteria as you query-object.
> If you have some problem with it, before LINQ, you should define your DSL.
> Now that you have LINQ you can use it as DSL and...
> http://code.google.com/p/linq-specifications/
>
>
> On Mon, May 10, 2010 at 12:01 PM, Sam <[email protected]> wrote:
>
>> I'm google searching for a best approach here and keep running up
>> against a lot of noise for linq expression trees and not enough on
>> using Nhibernate's criteria API.  Does anyone have a blog post or a
>> good recommendation on how I should best approach this implementation?
>>
>> I'm currently at an understanding that detached criteria's are likely
>> the best approach here, but I'm keeping an open mind.
>>
>> Thanks again and any help is appreciated.
>>
>> sam
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>>
>
>
> --
> Fabio Maulo
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to