define simple controller for app
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
22
FakePieShop/Controllers/PieController.cs
Normal file
22
FakePieShop/Controllers/PieController.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using FakePieShop.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace FakePieShop.Controllers
|
||||
{
|
||||
public class PieController : Controller
|
||||
{
|
||||
private readonly IPieRepository _pieRepository;
|
||||
private readonly ICategoryRepository _categoryRepository;
|
||||
|
||||
public PieController(IPieRepository pieRepository, ICategoryRepository categoryRepository)
|
||||
{
|
||||
_pieRepository = pieRepository;
|
||||
_categoryRepository = categoryRepository;
|
||||
}
|
||||
|
||||
public IActionResult List()
|
||||
{
|
||||
return View(_pieRepository.AllPies);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user