using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.EntityFrameworkCore; using CertAuth.Data; using CertAuth.Domain; namespace CertAuthAdmin.Pages.Collectors { public class CollectorsListModel : PageModel { private readonly CertAuth.Data.CertAuthContext _context; private readonly Models.CollectorsDA ClctrsDA; private readonly Controllers.CollectorsController Cntrlr; public CollectorsListModel(CertAuth.Data.CertAuthContext context) { _context = context; ClctrsDA = new Models.CollectorsDA(); Cntrlr = new Controllers.CollectorsController(_context); } public IList Collectors { get;set; } public IList Clctrs { get; set; } [BindProperty(Name = "editID", SupportsGet = true)] public int editID { get; set; } public async Task OnGetAsync() { //Collectors = await _context.Collectors.ToListAsync(); //Clctrs = ClctrsDA.GetAll().ToList(); Clctrs = Cntrlr.GetAll().ToList(); } } }