semesterWork/data/Repository/SQLPresenceRepository.cs
2024-12-13 08:47:52 +03:00

35 lines
1002 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Data.DAO;
using Microsoft.EntityFrameworkCore;
namespace data.Repository
{
public class SQLPresenceRepository
{
private readonly RemoteDatabaseContext _dbContext;
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;
}
}
}