mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Moved unused code into Achive
This commit is contained in:
36
Archive/HaLive/Pages/Briefe.cshtml.cs
Normal file
36
Archive/HaLive/Pages/Briefe.cshtml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using HaDocument.Interfaces;
|
||||
using HaDocument.Models;
|
||||
using System;
|
||||
|
||||
|
||||
namespace HaLive.Pages
|
||||
{
|
||||
public class BriefeModel : PageModel
|
||||
{
|
||||
internal ILibrary _lib;
|
||||
|
||||
[BindProperty(SupportsGet = true)]
|
||||
public string id { get; set; }
|
||||
|
||||
public BriefeModel(ILibrary lib) {
|
||||
_lib = lib;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(id)) {
|
||||
return RedirectPermanent("/Briefe/1");
|
||||
}
|
||||
var res = _lib.Metas.Where(x => x.Value.Autopsic == id);
|
||||
if (!res.Any() || !_lib.Metas.ContainsKey(res.First().Key)) {
|
||||
Response.StatusCode = 404;
|
||||
return RedirectToPage("/Error");
|
||||
}
|
||||
_lib.Metas.Where(x => x.Value.Autopsic == id).First();
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user