using Microsoft.EntityFrameworkCore;
using PARR.Core.Repositories.Interfaces.Schedule;
using PARR.DAL.Context;
using PARR.Domain.Entities.Schedule;

namespace PARR.DAL.Repositories
{
    internal class EsppSchTypeScheduleRepository : IEsppSchTypeScheduleRepository
    {
        private readonly DataContext dataContext;

        public EsppSchTypeScheduleRepository(DataContext dataContext)
        {
            this.dataContext = dataContext;
        }


        public IQueryable<EsppSchTypeSchedule> Get()
        {
            return dataContext.EsppSchTypeSchedules;
        }


        public async Task<EsppSchTypeSchedule?> GetAsync(int id)
        {
            return await dataContext.EsppSchTypeSchedules
                .FirstOrDefaultAsync(t => t.Id == id);
        }

    }
}
