Deserialize with LINQ query code in PageModel or PageView
I find you should keep the library code in the model and only parts that are relevant to views inside them.



In your case there is actually a third option. Let OnGet only handle the file. Remove OrderBy as this is a view's matter how it's displayed. Additionally initialize itemListReportages to an empty list if a file was empty. It'll save you the trouble of null checks later.

public void OnGet()
{
    PageSettings = (PagesSettings)HttpContext.Items["pagesettings"];

    if (PageSettings == null)
    {
        return;
    }

    var fileContent = _fileService.GetFileContentCached(PageSettings.DataFile);

    itemListReportages = 
        fileContent?.Length &gt; 0
            ? JsonConvert.DeserializeObject&lt;List&lt;Reportage&gt;&gt;(fileContent).Where(l =&gt; l.Published).ToList()
            : new List&lt;Reportage&gt;();
}


We don't see whether you initialize itemListReportages but this view could crash because you don't use the null propagation operator here: ?.Count


@for (var i = 0; i &lt; Model.itemListReportages.Count; i++)
{
    &lt;div class="item"&gt;
        &lt;div class="itembkg" style="background-image: url('@Model.itemListReportages[i].BkgImage');"&gt;&lt;/div&gt;
        &lt;div class="itemtxt"&gt;
            &lt;span&gt;@Model.itemListReportages[i].Text&lt;/span&gt;
        &lt;/div&gt;
    &lt;/div&gt;
}



With a non-null list you can turn this into a foreach loop and put OrderBy here. It'll make the code shorter too as you now have an item variable and no longer have to acces them by index like Model.itemListReportages[i]:

@foreach (var item in Model.itemListReportages.OrderBy(x =&gt; x.Name))
{
    &lt;div class="item"&gt;
        &lt;div class="itembkg" style="background-image: url('@item.BkgImage');"&gt;&lt;/div&gt;
        &lt;div class="itemtxt"&gt;
            &lt;span&gt;@item.Text&lt;/span&gt;
        &lt;/div&gt;
    &lt;/div&gt;
}