Next we will be talking about different ways to pass data to a view.
Using the model
By default, a Razor view inherits from RazorPage<dynamic>, which means that the model is prototyped as dynamic.
This will be the type for the Model property. This is a flexible solution because you can pass whatever you want in the model, but you won't get IntelliSense—Visual Studio support in completion—for it.
You could, however, specify a strongly typed model through inherits, like this:
@inherits RazorPage<ProcessModel>
This could also be achieved by using the model directive, like this:
@model ProcessModel
These are essentially the same. Visual Studio helps you find its properties and methods, as illustrated in the following screenshot:
One thing to keep in mind is that you cannot pass an anonymous type on your controller, as the view won...