The PageModel is the ViewModel in Razor Pages. The most common pattern is to add properties to the PageModel for each of your form inputs and annotate them as required. Alternatively, you can create a model class for your form inputs and add that
as a property to your PageModel. The first option is cleaner, and if you find that decorating a lot of properties with the
[BindProperty] attribute is tiresome, you can decorate the PageModel class with
[BindProperties] instead.
In razor pages, the @model is the binding model for form fields. It should be used to name and initial form fields, on post back it should be used for validation. Other models can be implemented as page properties.
The PageModel is the ViewModel in Razor Pages. The most common pattern is to add properties to the PageModel for each of your form inputs and annotate them as required. Alternatively, you can create a model class for your form inputs and add that
as a property to your PageModel. The first option is cleaner, and if you find that decorating a lot of properties with the
[BindProperty] attribute is tiresome, you can decorate the PageModel class with
[BindProperties] instead.