1234567891011121314151617181920212223242526272829 |
- using Microsoft.AspNetCore.Mvc;
- using ProRestaurant.Repository.Restaurants;
-
- namespace ProRestaurant.Controllers.Restaurants
- {
- [Route("api/[controller]")]
- [ApiController]
- public class MenuController : ControllerBase
- {
- private readonly IMenuRepository repo;
-
- public MenuController(IMenuRepository _repo)
- {
- repo = _repo;
- }
-
- [HttpGet("{id}")]
- public IActionResult Get(int id)
- {
- return new OkObjectResult(repo.GetMenu(id));
- }
-
- [HttpGet("GetOptions/{menuId}")]
- public IActionResult GetOptions(int menuId)
- {
- return new OkObjectResult(repo.GetOptions(menuId));
- }
- }
- }
|