Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created June 7, 2021 19:09
[ApiController]
[Route("[controller]")]
public class ProductsController : ControllerBase
{
private IRepository _repository;
public ProductsController(IRepository repository)
{
_repository=repository;
}
[HttpGet]
public async Task<List<Product>> Get(CancellationToken cancellationToken)
{
return await _repository.GetProducts(cancellationToken);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment