I'm going through a Pluralsight tutorial on creating .NET Core APIs using Visual Studio. The tutorial was authored back with .NET Core 2.2. I'm now using what I've learned in the Pluralsight course to write my own APIs. But I'm using .NET 5. This resulted in a problem, which I think is due to the difference in .NET Core versions.
The problem I ran into was in the ConfigureServices method of the Startup class. Speciflcally, this line:
That line worked fine, when using .NET Core 2.2. However, it caused me problems when I used .NET 5. I asked for help on Stack Overflow, and someone gave me a solution which builds and testing it I can retrieve data from the database. The above line of code is now like this:
I'm glad it works, but would like to know why it works. And I think it has to do with a change in .NET Core from 2.2 to 5. So, where do I go to learn about changes involving API's written with Visual Studio, from one .NET Core version to another?