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 Newtonsoft.Json; namespace CertAuthAdmin.Pages.TableMstr { public class ListTableMstrModel : PageModel { private readonly CertAuth.Data.CertAuthContext _context; private Controllers.TableMstrController tblMstrCtrlr; public IEnumerable tblMstr { get; set; } //public IList tblDtl { get; set; } public int tableId { get; set; } [BindProperty(SupportsGet = true)] public string tablecode { get; set; } public ListTableMstrModel(CertAuth.Data.CertAuthContext context) { _context = context; tblMstrCtrlr = new Controllers.TableMstrController(_context); //_UC = UC; } public void OnGet() { //tblMstr = (IEnumerable)_context.TableMstr.ToList(); //tblDtl = (IList)_context.TableDtl.ToList(); } public void OnPut() { //string vals = JsonConvert.SerializeObject(tblMstr); //tblMstrCtrlr.Put(tblMstr); _context.Attach(tblMstr).State = EntityState.Modified; _context.SaveChangesAsync(); } //public void GetRow(int theId, string theCode) //{ // tableId = theId; // tablecode = theCode; //} } }