I feel like I can get things done, but, I am far from a good programmer and it is annoying me.
Using Entity Framework Core, I'm creating a project and just had to build a many to many relationship that required me to use the Fluent API to set the ends correctly.
The moment I did this, I wasn't able to compile the project or really do anything as the default identity framework that was on the project was interfering. The error was:
The entity type 'IdentityUserLogin<string>' requires a primary key to be defined.
I spent a good amount of time trying to debug this issue with no luck what so ever. After a quick search, I found this question which whilst not exactly my issue (I have a single DbContext), the solution was to add the following:
base.OnModelCreating(modelBuilder);
The moment I did this, the project compiled and everything worked as expected.
So, my question really is - why? Can someone explain what is happening, why it's happening - but more importantly, it's great that Stack Overflow exists and I was able to get the answer, but, if you are a novice programmer, how would you understand and diagnose this issue?
I feel like whilst Stack Overflow is great for getting answers, I'm being lazy and I really want to learn why things are happening the way they are.