using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Serilog;
using WretchedMachines.DataAccess;
using WretchedMachines.DataAccess.Entities;

namespace WretchedMachines.Pages;

public class PrivacyModel : PageModel
{
    private readonly IDataAccess dataAccess;
    public IEnumerable<Item>? Items {get; set;}

    public PrivacyModel(IDataAccess dataAccess)
    {
        this.dataAccess = dataAccess;
        this.Items = new List<Item>();
    }

    public void OnGet()
    {
        Items = dataAccess.GetItems();
        Log.Information(Items!.Count().ToString());
    }
}

