-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuppliersController.cs
32 lines (26 loc) · 947 Bytes
/
SuppliersController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using DataInvoiceManager.API.Core.Models;
using Microsoft.AspNetCore.Mvc;
using DataInvoiceManager.API.Core.Helpers;
using DataInvoiceManager.API.Core.Interfaces;
namespace DataInvoiceManager.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class SuppliersController : ControllerBase
{
private readonly IWebHostEnvironment _env;
private readonly IConfiguration _config;
private readonly ISupplierRepository _supplierRepo;
public SuppliersController(IWebHostEnvironment env, IConfiguration config, ISupplierRepository supplierRepo)
{
_env = env;
_config = config;
_supplierRepo = supplierRepo;
}
[HttpGet("getList")]
public async Task<IEnumerable<Supplier>> getList([FromQuery] int? limit)
{
return await _supplierRepo.getList(Common.getLimit(limit, _config));
}
}
}