Syntax
SELECT
"Title" AS "Item.Title",
"CreatedOn" AS "Item.CreatedOn"
FROM
"Blog"
Directives
Razor SQL vs ASP.NET
Jerrycurl's implementation of Razor is in most ways similar to ASP.NET Razor, but for ease of use there are a few minor discrepancies you might want to know.
Escaping
As Razor SQL works with SQL
Namespace imports
Instead of @using
clauses, Razor SQL uses the @import
directive
to import namespaces.
@import Jerrycurl.Mvc.Sql.SqlServer
Implicit SQL
Where Razor HTML implicitly uses C# code in an enclosing block, Razor SQL does not.
@if (true)
{
@{
// explicit C#
}
-- implicit SQL
}