
How it works...
Let's have a look what we did just now. From steps 1 to 9, we opened and previously built an existing solution containing .NET Standard 2.0 library code. Then, we added an ASP.NET Core project to that solution. In step 10, we told Visual Studio to execute the ASP.NET Core project when we hit F5 or started debugging. In step 11, we tested the default template of ASP.NET Core in a default browser.
In steps 12 to 14, we added the reference to our ASP.NET Core application from the .NET Standard 2.0 class library. This allows you to access the library from an ASP.NET Core 2.0 web application. In step 16, we referenced the class library using the using directive. In step 17, we created a variable to hold the name and created an instance of the HelloUniverse class.
Finally, we have stored the message from the SayHello() method in the ViewData collection. The ViewData collection allows you to transfer data from Controllers to Views. In steps 19 and 20, we opened the relevant view for the About() action, which is About.cshtml. Finally, in step 20, we added simple HTML code to display the stored value in ViewData in the HomeController class. As a last step, we executed the web application and tested it.