question

RodFalanga avatar image
0 Votes"
RodFalanga asked Bruce-SqlWork answered

Where do I go to learn about changes to WebAPI's when new versions of .NET come out?

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:

 services.AddAutoMapper();

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:

 services.AddAutoMapper(typeof(Startup));

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?

dotnet-csharpdotnet-aspnet-core-webapi
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Crypt32 avatar image
1 Vote"
Crypt32 answered RodFalanga commented

.AddAutoMapper is extension member to IServiceCollection developed by Automapper developers. It is 3rd party extension, not Microsoft, thus you never find this in Microsoft release notes. 3rd party NuGet packages often include links to their docs, GitHub repos where you can find changes between 3rd party extension releases.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I did not know that AutoMapper was a third party product!! Thank you!

0 Votes 0 ·
Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

The documentation has a what’s new in .net section which gives the changes for each release.

https://docs.microsoft.com/en-us/dotnet/fundamentals/

If you check the project references you will see what 3rd party packages you are using. The Microsoft ones start with system. or Microsoft.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.