idk some fix to connect DbContexts
This commit is contained in:
parent
6e8d6cebdd
commit
d623a7f1e7
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<Completion> Completions { get; set; }
|
||||||
public DbSet<Answer> Answers { 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