using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces;

namespace PARR.DAL.Services.Implementations
{
    internal class EsppSchTypeScheduleService : IEsppSchTypeScheduleService
    {
        private readonly DataContext dataContext;

        public EsppSchTypeScheduleService(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);
        }

    }
}
