2020-09-16 02:14:31 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Snootalogue.Data;
|
|
|
|
using Snootalogue.Models;
|
|
|
|
|
|
|
|
namespace Snootalogue.Pages.Documents {
|
|
|
|
public class DetailsModel : PageModel {
|
|
|
|
private readonly SnootalogueContext _context;
|
|
|
|
public Document Document { get; set; }
|
|
|
|
|
|
|
|
public DetailsModel(SnootalogueContext context) {
|
|
|
|
_context = context;
|
|
|
|
}
|
|
|
|
|
2020-09-20 03:43:08 +00:00
|
|
|
public async Task<IActionResult> OnGetAsync(string id) {
|
2020-09-16 02:14:31 +00:00
|
|
|
if (id == null) {
|
|
|
|
return NotFound();
|
|
|
|
}
|
|
|
|
|
|
|
|
Document = await _context.Document.FirstOrDefaultAsync(d => d.ID == id);
|
|
|
|
|
|
|
|
if (Document == null) {
|
|
|
|
return NotFound();
|
|
|
|
}
|
|
|
|
|
|
|
|
return Page();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|