How it works...

We created a blank solution in steps 1 to 5. In steps 7 to 10, we added a .NET Standard 2.0 Class Library project to the solution. We have given a meaningful name to the project in these steps. We renamed the default class name generated from the template in steps 12 and 13. We added a using statement for LINQ in step 14. This is necessary to explain the lambda expressions using LINQ.

In step 16, we added code to create a delegate and a method to use that delegate as a parameter. The delegate Message takes a parameter as a string and returns the output as a string. Then, we added a method to add two numbers and return the answer as a string with a message. As you can see, there are three parameters for the AddTwoNumbers() ...

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.