2025-06-19 21:50:35 +02:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Bimix.Infrastructure.Data;
|
|
|
|
|
using Bimix.Domain.Entities;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Bimix.API.Controllers;
|
|
|
|
|
|
|
|
|
|
[ApiController]
|
2025-06-23 21:52:09 +02:00
|
|
|
[Route("api/[controller]")]
|
2025-06-19 21:50:35 +02:00
|
|
|
public class ProductsController(BimixDbContext context) : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly BimixDbContext _context = context;
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult<IEnumerable<Product>>> GetProducts()
|
|
|
|
|
{
|
|
|
|
|
return await _context.Products.ToListAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|