semesterWork/domain/Service/PresenceService.cs
2024-12-13 08:47:52 +03:00

31 lines
799 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Data.DAO;
using data.Repository;
namespace domain.Service
{
public class PresenceService
{
private readonly SQLPresenceRepository _presenceRepository;
public PresenceService(SQLPresenceRepository presenceRepository)
{
_presenceRepository = presenceRepository;
}
public List<Attendance> GetAllAttendances()
{
return _presenceRepository.GetAllPresences().ToList();
}
public List<Attendance> GetAttendancesRelativeWithGroup(int groupId)
{
return _presenceRepository.GetAllPresences().Where(pres => pres.Group.GroupId == groupId).ToList();
}
}
}