You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
532 B
24 lines
532 B
11 months ago
|
using ContosoPizza.Models;
|
||
|
using ContosoPizza.Services;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||
|
|
||
|
namespace ContosoPizza.Pages
|
||
|
{
|
||
|
public class PizzaListModel : PageModel
|
||
|
{
|
||
|
private readonly PizzaService _service;
|
||
|
public IList<Pizza> PizzaList { get; set; } = default;
|
||
|
|
||
|
public PizzaListModel(PizzaService service)
|
||
|
{
|
||
|
_service = service;
|
||
|
}
|
||
|
|
||
|
public void OnGet()
|
||
|
{
|
||
|
PizzaList = _service.GetPizzas();
|
||
|
}
|
||
|
}
|
||
|
}
|