Projektdateien hinzufügen.
This commit is contained in:
26
Webshop.Api/Controllers/ProductsController.cs
Normal file
26
Webshop.Api/Controllers/ProductsController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
// src/Webshop.Api/Controllers/ProductsController.cs
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webshop.Application.DTOs;
|
||||
using Webshop.Application.Services;
|
||||
|
||||
namespace Webshop.Api.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ProductsController : ControllerBase
|
||||
{
|
||||
private readonly ProductService _productService;
|
||||
|
||||
public ProductsController(ProductService productService)
|
||||
{
|
||||
_productService = productService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<ProductDto>>> GetAllProducts()
|
||||
{
|
||||
var products = await _productService.GetAllProductsAsync();
|
||||
return Ok(products);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user