diff --git a/SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs b/SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs index d77fb6d..f505684 100644 --- a/SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs +++ b/SurveyLib.Infrastructure.EFCore/Data/SurveyDbContext.cs @@ -16,7 +16,12 @@ public class SurveyDbContext : DbContext public DbSet Completions { get; set; } public DbSet Answers { get; set; } - public SurveyDbContext(DbContextOptions options) : base(options) + public SurveyDbContext(DbContextOptions options) : base(options) { } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity().HasKey(a => new { a.CompletionId, a.QuestionId }); + } } \ No newline at end of file