Pass in an XML document as a parameter to an Nhibernate ICriteria?
So I have a query I need to run in NHibernate as a DetachedCriteria开发者_如何学C. The problem I'm having (extremely similar to this one) is that my query can have many thousands of input parameters, and there's a hard limit in SQL Server of 2100. I believe that the solution is to put my parameter-list inside an XML document, and pass that as a single parameter. It is described on the aforementioned page as working thusly:
session.CreateCriteria(typeof(Customer))
.Add(XmlIn.Create("id", potentiallyLargeAmount))
List();
Which sounds EXACTLY like what I need. However, I cannot find this XmlIn functionality anywhere in NHibernate! Where is this functionality implemented? How can I access it? Also, how does it actually parse/handle the XML? Do I need to conform to a schema of some sort?
It looks like this is in Rhino-Commons. I'm not all that familiar with it but after some googling I found it here: https://github.com/lorenzomelato/rhino-commons/blob/master/Rhino.Commons.NHibernate/NHibernate/XmlIn.cs
Here is where I found out where to get Rhino-Commons from:
Where to get Rhino Commons
Here is the link though:
http://github.com/lorenzomelato/rhino-commons
精彩评论