Files
TechHelper/TechHelper.Server/Repositories/ExamRepository.cs
2025-06-20 18:58:11 +08:00

63 lines
1.2 KiB
C#

using Entities.Contracts;
using Entities.DTO;
using Microsoft.EntityFrameworkCore;
using SharedDATA.Api;
using TechHelper.Repository;
namespace TechHelper.Server.Repositories
{
public class ExamRepository : IExamRepository
{
private readonly IUnitOfWork _unitOfWork;
private readonly IRepository<Assignment> _assignmentRepo;
private readonly IRepository<Question> _questionRepo;
public ExamRepository(IUnitOfWork unitOfWork)
{
_unitOfWork = unitOfWork;
_assignmentRepo = _unitOfWork.GetRepository<Assignment>();
}
public async Task<Assignment?> GetFullExamByIdAsync(Guid assignmentId)
{
return null;
}
public async Task<IEnumerable<Assignment>> GetExamPreviewsByUserAsync(Guid userId)
{
return await _assignmentRepo.GetAllAsync(
predicate: a => a.CreatorId == userId && !a.IsDeleted);
}
public async Task AddAsync(Assignment assignment)
{
await _assignmentRepo.InsertAsync(assignment);
}
public async Task AddAsync(QuestionGroupDto qg)
{
if (qg.ValidQuestionGroup)
{
}
}
public async Task AddAsync(AssignmentQuestion assignment)
{
}
public async Task AddAsync(Question assignment)
{
}
public async Task AddAsync(AssignmentClass assignment)
{
}
}
}