19 lines
499 B
C#
19 lines
499 B
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
using Bimix.Infrastructure.Data;
|
||
|
|
using Bimix.Domain.Entities;
|
||
|
|
using Microsoft.EntityFrameworkCore;
|
||
|
|
|
||
|
|
namespace Bimix.API.Controllers;
|
||
|
|
|
||
|
|
[Route("api/[controller]")]
|
||
|
|
[ApiController]
|
||
|
|
public class ProductsController(BimixDbContext context) : ControllerBase
|
||
|
|
{
|
||
|
|
private readonly BimixDbContext _context = context;
|
||
|
|
|
||
|
|
[HttpGet]
|
||
|
|
public async Task<ActionResult<IEnumerable<Product>>> GetProducts()
|
||
|
|
{
|
||
|
|
return await _context.Products.ToListAsync();
|
||
|
|
}
|
||
|
|
}
|