@inherits Custom.Hybrid.Razor14
<!-- unimportant stuff, hidden -->
@using ToSic.Razor.Blade;
@using System.Linq;
SQL from a App.Query, setting Params The... <!-- unimportant stuff, hidden -->
<div class="row">
<div class="col-lg-7">
<h2>Root Portal</h2>
<div>In this example we will set the PortalId for the SQL query.</div>
@{
// get the query and set a parameter
var query = App.Query["DnnFilesFromSql"];
query.Params("PortalId", "0");
var rootFiles = AsList(query);
}
<ul>
@foreach(var file in rootFiles) {
<li>
@file.FileName
</li>
}
</ul>
</div>
<div class="col-lg-5">
@fancybox.PreviewWithLightbox(App.Path + "/data/assets/sql-query-dnn-files.png", width, height, "float-left", label: "Query Tree")
@fancybox.PreviewWithLightbox(App.Path + "/data/assets/sql-query-configuration.png", width, height, "float-left", label: "Query Configuration with Params and Test-Values")
@fancybox.PreviewWithLightbox(App.Path + "/data/assets/sql-query-select-statement.png", width, height, "float-left", label: "SQL Query using Params")
</div>
</div>
<!-- unimportant stuff, hidden -->