When creating a criteria in NHibernate I can use
Restriction.In() or
Restriction.InG()
What is the difference between them?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
InG is the generic equivalent of In (for collections)
The signatures of the methods are as follows (only the ICollection In overload is shown):
vs.
Looking at NHibernate’s source code (trunk) it seems that they both copy the collection to an object array and use that going forward, so I don’t think there is a performance difference between them.
I personally just use the In one most of the time – its easier to read.