added DataContext.cs

This commit is contained in:
Вячеслав 2025-03-14 22:47:19 +05:00
parent 4e3c3e6149
commit 7d06084dfb
6 changed files with 50 additions and 4 deletions

View file

@ -1,10 +1,19 @@
using SurveyLib.Core.Models;
using SurveyLib.Core.Repositories;
using Microsoft.EntityFrameworkCore;
using SurveyLib.Infrastructure.EFCore.Data;
namespace SurveyLib.Infrastructure.EFCore.Repositories;
public class AnswerRepository : IAnswerRepository
{
private readonly DataContext _context;
public AnswerRepository(DataContext context)
{
_context = context;
}
public Task<Answer>? GetByIdAsync(int id)
{
throw new NotImplementedException();

View file

@ -1,10 +1,18 @@
using SurveyLib.Core.Models;
using SurveyLib.Core.Repositories;
using SurveyLib.Infrastructure.EFCore.Data;
namespace SurveyLib.Infrastructure.EFCore.Repositories;
public class CompletionRepository : ICompletionRepository
{
private readonly DataContext _context;
public CompletionRepository(DataContext context)
{
_context = context;
}
public Task<Completion>? GetByIdAsync(int id)
{
throw new NotImplementedException();

View file

@ -1,10 +1,18 @@
using SurveyLib.Core.Models;
using SurveyLib.Core.Repositories;
using SurveyLib.Infrastructure.EFCore.Data;
namespace SurveyLib.Infrastructure.EFCore.Repositories;
public class QuestionRepository : IQuestionRepository
{
private readonly DataContext _context;
public QuestionRepository(DataContext context)
{
_context = context;
}
public Task<QuestionBase>? GetByIdAsync(int id)
{
throw new NotImplementedException();

View file

@ -1,10 +1,18 @@
using SurveyLib.Core.Models;
using SurveyLib.Core.Repositories;
using SurveyLib.Infrastructure.EFCore.Data;
namespace SurveyLib.Infrastructure.EFCore.Repositories;
public class SurveyRepository : ISurveyRepository
{
private readonly DataContext _context;
public SurveyRepository(DataContext context)
{
_context = context;
}
public Task<Survey>? GetByIdAsync(int id)
{
throw new NotImplementedException();