Snootalogue/Pages/Index.cshtml.cs

27 lines
671 B
C#
Raw Normal View History

2020-09-15 12:31:52 +00:00
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Snootalogue.Models;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Snootalogue.Data;
namespace Snootalogue.Pages {
public class IndexModel : PageModel {
private readonly SnootalogueContext context;
public IList<Document> Documents { get; set; }
public string Search { get; set; }
public IndexModel(SnootalogueContext context) {
this.context = context;
}
public async Task OnGetAsync() {
Documents = await context.Document.ToListAsync();
}
}
}