I read here that using ORM (like nHibernate) does not necessarily prevent SQL injection; for example, if you keep creating dynamic queries using your ORM framework you are still vulnerable.
Fine, then what is the proper use of ORM to avoid all types of SQL injection? Should we use Parameterized Queries using our ORM framework? Does something like nHibernate escape special SQL characters like single quote so developers do not write a piece of code like this:
private string SafeSqlLiteral(string inputSQL) { return inputSQL.Replace("'", "''"); }