Skip to content

Instantly share code, notes, and snippets.

@marciol
Created August 7, 2012 22:43
Show Gist options
  • Save marciol/3290143 to your computer and use it in GitHub Desktop.
Save marciol/3290143 to your computer and use it in GitHub Desktop.
Custom System Routes (Nancy inspired)
Get("foo/bar.html",
(request, response) => {
using (var connection = new SqlConnection(
System.Configuration.ConfigurationManager.AppSettings["strConnection"]))
{
connection.Open();
var result = connection.Query<ExecutiveReportResult>(
Util.getSql("rm_consulta_relatorio_executivo"),
new { Anos = new int[] { 2012 }, Meses = new int[] { 1, 2, 3 }, CodigoInterno = "1.1.4" });
Render("ExecutiveReport.liquid", result, response);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment