using CanteenContracts.BusinessLogicsContracts; using CanteenContracts.View; using Microsoft.AspNetCore.Mvc; namespace CanteenRestApi.Controllers { [Route("api/[controller]/[action]")] [ApiController] public class MainController : ControllerBase { private readonly ILogger _logger; private readonly ICookLogic _cook; private readonly IDishLogic _dish; private readonly IProductLogic _product; public MainController(ILogger logger, ICookLogic cook, IDishLogic dish, IProductLogic product) { _logger = logger; _cook = cook; _dish = dish; _product = product; } [HttpGet] public List? GetCookList() { try { return _cook.ReadList(null); } catch (Exception ex) { _logger.LogError(ex, "Error during loading list of bouquets"); throw; } } } }