Hi there people.
I need to recreate a query using nHibernate Criteria. This query had a where clause that was pretty ugly.
((t.Disposition_CD)='ac' Or
(t.Disposition_CD)='cc' Or
(t.Disposition_CD)='Co' Or
(t.Disposition_CD)='SF' Or
(t.Disposition_CD)='SC' Or
(t.Disposition_CD)='OR' Or
(t.Disposition_CD)='SV' Or
(t.Disposition_CD)='RI' Or
(t.Disposition_CD)='WN' Or
(t.Disposition_CD)='NC' Or
(t.Disposition_CD)='DN' Or
(t.Disposition_CD)='WT' Or
(t.Disposition_CD)='MA' Or
(t.Disposition_CD)='TO' Or
(t.Disposition_CD)='OC'))
so, I started here
IList leadList =
session.CreateCriteria(typeof(Lead)).Add(Expression.In("CallDisposition",
new string[] {"AC","CC" })).List();
the problem the Property on Lead is a CallDisposition
Object and gives me a Unknown entity class: System.String
error when I try to do this. An Array of CallDisposition
is what it's looking for.
Basically what I'm looking for is a list of Leads that meet all the or criteria of the original query. Any suggestions are helpful.