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.Items { public class ItemsListModel : PageModel { private readonly CertAuth.Data.CertAuthContext _context; private readonly Models.ItemsDA ItmsDA; private readonly Controllers.ItemsController Cntrlr; public ItemsListModel(CertAuth.Data.CertAuthContext context) { _context = context; ItmsDA = new Models.ItemsDA(); Cntrlr = new Controllers.ItemsController(_context); } public IList Items { get; set; } public IList ItemsWD { get; set; } [BindProperty(Name ="editID", SupportsGet = true)] public int editID { get; set; } public async Task OnGetAsync() { //Items = await _context.Items.ToListAsync(); //ItemsWD = ItmsDA.GetAll_WD().ToList(); ItemsWD = Cntrlr.GetAll_WD().ToList(); } } }