parent
2a64a14eb2
commit
38a0af9925
Binary file not shown.
@ -0,0 +1,23 @@ |
|||||||
|
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(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue