NHibernate LINQ 3.0 Oracle Expression type 10005 is not supported by this SelectClauseVisitor -
i have following linq query
queryresult<list<persondemographic>> members = new queryresult<list<persondemographic>>(); var query = (from ms in this.session.query<membersummary>() ms.namesearch.startswith(firstname.toupper()) && ms.namesearch2.startswith(lastname.toupper()) select new persondemographic { firstname = ms.firstname.topropercase(), lastname = ms.lastname.topropercase(), personid = ms.id, address = new address { line1 = ms.addressline1.topropercase(), line2 = ms.addressline2.topropercase(), city = ms.city.topropercase(), state = ms.state, zipcode = ms.zipcode, }, phonenumber = new phonenumber { number = string.isnullorwhitespace(ms.phonenumber) ? null : regex.replace(ms.phonenumber, @"(\d{3})(\d{3})(\d{4})", "$1-$2-$3") } }); if (this.session.transaction.isactive) { members.data = query.distinct().take(15).tolist(); } else { using (var transaction = this.session.begintransaction()) { members.data = query.distinct().take(15).tolist(); transaction.commit(); } } the code running under transaction section. if use without distinct have no problem. adding distinct gives me exception
{"expression type 10005 not supported selectclausevisitor."}
i can't find definitive. can help?
thanks, paul
there lots of things in query nh can't possibly know how translate sql:
- topropercase (that looks extension method of yours)
- string.isnullorwhitespace (that's new in .net 4, nh compiled against 3.5)
- regex.replace (that's not possible sql, unless have db supports , write dialect it)
Comments
Post a Comment