var sql = new SqlString(); sql.Append("SELECT * FROM Customers WHERE City = ?"); sql.AddParameter("London"); Console.WriteLine(sql.ToString());
var sql = new SqlString(); sql.AppendLine("UPDATE Products SET Price = Price * 0.9"); sql.AppendLine("WHERE Category = ?"); sql.AddParameter("Books"); sql.AppendLine("AND Price > ?"); sql.AddParameter(50.0); Console.WriteLine(sql.ToString());This code builds an SQL statement for updating the prices of products in the Books category. It applies a 10% discount to all prices and only updates products that originally had a price of over $50. The resulting SQL string is printed to the console. NHibernate.SqlCommand is part of the NHibernate package library.