first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using BethanysPieShopHRM.Api.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BethanysPieShopHRM.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class CountryController : Controller
|
||||
{
|
||||
private readonly ICountryRepository _countryRepository;
|
||||
|
||||
public CountryController(ICountryRepository countryRepository)
|
||||
{
|
||||
_countryRepository = countryRepository;
|
||||
}
|
||||
|
||||
// GET: api/<controller>
|
||||
[HttpGet]
|
||||
public IActionResult GetCountries()
|
||||
{
|
||||
return Ok(_countryRepository.GetAllCountries());
|
||||
}
|
||||
|
||||
// GET api/<controller>/5
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult GetCountryById(int id)
|
||||
{
|
||||
return Ok(_countryRepository.GetCountryById(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user