using Microsoft.EntityFrameworkCore;
using MTWorkHR.Core.Entities;
using MTWorkHR.Core.IDto;
using MTWorkHR.Core.IRepositories;
using MTWorkHR.Infrastructure.Entities;
using MTWorkHR.Infrastructure.DBContext;

namespace MTWorkHR.Infrastructure.Repositories
{
    public class MeetingUserRepository : Repository<MeetingUser>, IMeetingUserRepository
    {
        private readonly DbSet<MeetingUser> dbSet;

        public MeetingUserRepository(HRDataContext context) : base(context)
        {
            dbSet = context.Set<MeetingUser>();

        }
        public virtual async Task<MeetingUser> AddAsync(MeetingUser entity)
        {
            await dbSet.AddAsync(entity);
            return entity;
        }

        public virtual async Task<IList<MeetingUser>> AddRangeAsync(IList<MeetingUser> entity)
        {
            await dbSet.AddRangeAsync(entity);
            return entity;
        }

        public virtual async Task DeleteAsync(MeetingUser entity)
        {
            dbSet.Remove(entity);
        }

        public virtual async Task DeleteAsync(IEnumerable<MeetingUser> entities)
        {
            dbSet.RemoveRange(entities);
        }
    }
}
