SqlString sqlString = new SqlString("SELECT * FROM Customers WHERE City = ?"); sqlString.Append(" AND Country = ?");
SELECT * FROM Customers WHERE City = ? AND Country = ?
SqlString sqlString = new SqlString("SELECT COUNT(*) FROM Orders"); sqlString.Append(" WHERE OrderDate BETWEEN ? AND ?");
SELECT COUNT(*) FROM Orders WHERE OrderDate BETWEEN ? AND ?In both of these examples, we're using NHibernate.SqlCommand's SqlString class to construct SQL queries by appending multiple string fragments together. Package library: NHibernate.SqlCommand (available on NuGet)