Files
aviq-second-boilerplate/BethanysPieShopHRM.Api/Models/JobCategoryRepository.cs
T
2026-03-22 00:29:34 +01:00

25 lines
662 B
C#

using BethanysPieShopHRM.Shared.Domain;
namespace BethanysPieShopHRM.Api.Models
{
public class JobCategoryRepository: IJobCategoryRepository
{
private readonly AppDbContext _appDbContext;
public JobCategoryRepository(AppDbContext appDbContext)
{
_appDbContext = appDbContext;
}
public IEnumerable<JobCategory> GetAllJobCategories()
{
return _appDbContext.JobCategories;
}
public JobCategory GetJobCategoryById(int jobCategoryId)
{
return _appDbContext.JobCategories.FirstOrDefault(c => c.JobCategoryId == jobCategoryId);
}
}
}