31 lines
799 B
C#
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();
|
|
}
|
|
}
|
|
}
|