first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using BethanysPieShopHRM.Shared.Domain;
|
||||
|
||||
namespace BethanysPieShopHRM.Api.Models
|
||||
{
|
||||
public class CountryRepository : ICountryRepository
|
||||
{
|
||||
private readonly AppDbContext _appDbContext;
|
||||
|
||||
public CountryRepository(AppDbContext appDbContext)
|
||||
{
|
||||
_appDbContext = appDbContext;
|
||||
}
|
||||
|
||||
public IEnumerable<Country> GetAllCountries()
|
||||
{
|
||||
return _appDbContext.Countries;
|
||||
}
|
||||
|
||||
public Country GetCountryById(int countryId)
|
||||
{
|
||||
return _appDbContext.Countries.FirstOrDefault(c => c.CountryId == countryId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user