understood my mistake and created DataContext.cs with new name lol
This commit is contained in:
parent
90f4f9dd51
commit
8959c3d984
5 changed files with 25 additions and 8 deletions
17
SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs
Normal file
17
SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using SurveyLib.Core.Models;
|
||||
|
||||
namespace SurveyLib.Infrastructure.EFCore.Data;
|
||||
|
||||
public class SurveyDbContext : DbContext
|
||||
{
|
||||
public DbSet<Survey> Surveys { get; set; }
|
||||
public DbSet<QuestionBase> Questions { get; set; }
|
||||
public DbSet<Completion> Completions { get; set; }
|
||||
public DbSet<Answer> Answers { get; set; }
|
||||
|
||||
public SurveyDbContext(DbContextOptions<SurveyDbContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@ namespace SurveyLib.Infrastructure.EFCore.Repositories;
|
|||
|
||||
public class AnswerRepository : IAnswerRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
private readonly SurveyDbContext _context;
|
||||
|
||||
public AnswerRepository(DataContext context)
|
||||
public AnswerRepository(SurveyDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace SurveyLib.Infrastructure.EFCore.Repositories;
|
|||
|
||||
public class CompletionRepository : ICompletionRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
private readonly SurveyDbContext _context;
|
||||
|
||||
public CompletionRepository(DataContext context)
|
||||
public CompletionRepository(SurveyDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace SurveyLib.Infrastructure.EFCore.Repositories;
|
|||
|
||||
public class QuestionRepository : IQuestionRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
private readonly SurveyDbContext _context;
|
||||
|
||||
public QuestionRepository(DataContext context)
|
||||
public QuestionRepository(SurveyDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ namespace SurveyLib.Infrastructure.EFCore.Repositories;
|
|||
|
||||
public class SurveyRepository : ISurveyRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
private readonly SurveyDbContext _context;
|
||||
|
||||
public SurveyRepository(DataContext context)
|
||||
public SurveyRepository(SurveyDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue