using LendWise.Web.Services; using Microsoft.AspNetCore.Mvc; namespace LendWise.Web.Controllers; [Route("products")] public class ProductsController(ProductCatalog catalog) : Controller { [HttpGet("")] public IActionResult Index() => View(); [HttpGet("{slug}")] public IActionResult Details(string slug) { var product = catalog.Find(slug); return product is null ? NotFound() : View(product); } }