Initial commit: project structure, bez lokalnych secrets
This commit is contained in:
19
Bimix.API/Controllers/ProductsController.cs
Normal file
19
Bimix.API/Controllers/ProductsController.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user