Dapper Parameter replace not working for Top
Newer versions of dapper have literal replacements and they work great in this case:
var sql = "Select Top {=MaxLimit} from Table WHere data = @Id";
In SQL Server any top
expression other than a numeric constant needs to be in parentheses.
SELECT TOP (@MaxLimit) FROM ...