How it works...

In steps 1 to 11, we created an empty solution. Then we added a .NET Standard 2.0 library to that solution. Again, as a good practice we properly named the solution and the class library project. In steps 12 and 13, we changed the name of the default Class1.cs created by Visual Studio. In step 15, we added using directives required for our task. In step 16, we created a class-wide private variable to hold the service URL. Then, in step 16 we created the default constructor with a string parameter that updates the private variable in step 15.

In step 18, we created the public method that did the actual work of reading the RESTful API. In the first line of code, we created a string variable that held the output from the service. ...

Get .NET Standard 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.