Given this sql schema:
create table [dbo].[Courses_Students] (
[DummyColumn] [int] null,
[CourseId] [int] not null,
[StudentId] [int] not null,
primary key ([CourseId], [StudentId])
);
How do I define the composite primary key and the additional columns in the EntityConfiguration?
You need to declare a class
Courses_StudentsThe Key on CourseId, is to prevent a compilation error, you will override it next.
Then, in your DbContext class, you override OnModelCreating like so :