Fluent nhibernate: problem in where clause -
I'm using fluent nhibernate.
I have written a piece of code, add
var data = session.CreateCriteria (typeof (CustomerNameValueList)). (Expression. Act ("CustomerId", "3")). List & lt; CustomerNameValueList & gt; (); But the query generated by nhibernate looks like
Select column 1, column 2, column 3, where the table CustomerId =? The problem is with "customer ID ="? Expired: CustomerId = 3 "
Why customerId = instead of client = 3
please help me.
There is nothing wrong with this query. '?' The string will be replaced with the string value of "3." If your column type is actually an int you may have a problem.The parameterization of the query is that you want to do against the attacks of SQL injection. CustomerId = '3' in the query, as you'd expect, and '3' came from a text box on a web page, then it would be possible to inject more SQL like '3' DELETE FROM MyUserTable.
Comments
Post a Comment