Merge branch 'unstable' into 'main'
idk some fix to connect DbContexts See merge request internship-2025/survey-webapp/surveylib!8
This commit is contained in:
commit
7bbc78fbd7
1 changed files with 6 additions and 1 deletions
|
|
@ -16,7 +16,12 @@ public class SurveyDbContext : DbContext
|
|||
public DbSet<Completion> Completions { get; set; }
|
||||
public DbSet<Answer> Answers { get; set; }
|
||||
|
||||
public SurveyDbContext(DbContextOptions<SurveyDbContext> options) : base(options)
|
||||
public SurveyDbContext(DbContextOptions options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Answer>().HasKey(a => new { a.CompletionId, a.QuestionId });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue