Not the way it’s been designed, all SqlExpression’s calls their Dialect’s ToSelectStatement() to return the generated SQL string conforming to their RDBMS dialect.
You have an opportunity to modify the SQL that gets executed with a Custom SqlExpression Filter where you’d basically need to parse the SQL suffix and replace the value with a param, you should be able to add a SqlExpression<T>.ParameterizedLimit(limit) extension method to make calling it nicer.
The other way to avoid parsing is to inherit from SqlServerExpression<T> and override string ToSelectStatement() to use your own custom implementation that constructs the SQL with params.
You can make use of it by creating a custom SQL Server provider and returning your SqlServerExpression<T> in its SqlExpression<T>() method, e.g:
public class MySqlServerOrmLiteDialectProvider
: SqlServer2012OrmLiteDialectProvider
{
public new static MySqlServerOrmLiteDialectProvider Instance =
new MySqlServerOrmLiteDialectProvider();
public override SqlExpression<T> SqlExpression<T>() =>
new MySqlServerExpression<T>(this);
}
Then you’d use your custom dialect provider implementation instead:
var dbFactory = new OrmLiteConnectionFactory(connString,
MySqlServerOrmLiteDialectProvider.Instance);