2024-12-12 19:47:32 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2024-12-13 05:47:52 +00:00
|
|
|
|
using Data.DAO;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-12-12 19:47:32 +00:00
|
|
|
|
|
|
|
|
|
namespace data.Repository
|
|
|
|
|
{
|
|
|
|
|
public class SQLPresenceRepository
|
|
|
|
|
{
|
|
|
|
|
private readonly RemoteDatabaseContext _dbContext;
|
2024-12-13 05:47:52 +00:00
|
|
|
|
|
|
|
|
|
public SQLPresenceRepository(RemoteDatabaseContext remoteDatabaseContext)
|
|
|
|
|
{
|
|
|
|
|
_dbContext = remoteDatabaseContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Attendance> GetAllPresences()
|
|
|
|
|
{
|
|
|
|
|
var result = _dbContext.Attendances
|
|
|
|
|
.Include(attendance => attendance.GroupSubject)
|
|
|
|
|
.ThenInclude(groupSubject => groupSubject.Subject)
|
|
|
|
|
.Include(groupSubject => groupSubject.GroupSubject.Semester)
|
|
|
|
|
.Include(attendance => attendance.Student)
|
|
|
|
|
.Include(attendance => attendance.Group)
|
|
|
|
|
.Include(attendance => attendance.Visit);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
}
|
2024-12-12 19:47:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|