drinkrate/DrinkRateAPI/Controllers/ProductTableController.cs
martinshoob b7677bc139 Create product-company table coupling, fix one-to-one relationship
Introduce a new entity to couple product and company tables.
2025-08-11 21:03:28 +02:00

28 lines
No EOL
801 B
C#

using DrinkRateAPI.ApiModels.ProductTable;
using DrinkRateAPI.AuthorizationPolicies;
using DrinkRateAPI.DbEntities;
using DrinkRateAPI.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DrinkRateAPI.Controllers;
[ApiController]
[Route("productTable")]
public class ProductTableController : ControllerBase
{
private ProductTableService _productTableService;
public ProductTableController(ProductTableService productTableService)
{
_productTableService = productTableService;
}
[HttpGet("{productTableName}")]
[Produces("application/json")]
public async Task<ProductTableGet> GetProductTable([FromRoute] string productTableName)
{
return await _productTableService.GetProductTable(productTableName);
}
}