public async Task <IActionResult> Index([FromServices] IPastryService pastryService)
        {
            ViewData["Title"] = "Benvenuto alla Pasticceria Teutonica di Luana e Maria";
            List <PastryViewModel> availablePastries = await pastryService.GetAvailablePastriesAsync();

            HomeViewModel viewModel = new()
            {
                AvailablePastriesList = availablePastries
            };

            return(View(viewModel));
        }
    }
Beispiel #2
0
 public Pie2Service(
     IPie2DataService pieDataService,
     IPastryService pastryService,
     IFillingService fillingService,
     ILogger logger,
     INowAdapter nowService)
 {
     _pieDataService = pieDataService;
     _pastryService  = pastryService;
     _fillingService = fillingService;
     _logger         = logger;
     _nowService     = nowService;
 }
Beispiel #3
0
 public PieService()
 {
     _pieDataService = new PieDataService();
     _pastryService  = new PastryService();
     _fillingService = new FillingService();
 }
Beispiel #4
0
 public PastriesController(IPastryService pastryService)
 {
     this.pastryService = pastryService;
 }