Razor Pageswasintroduced in ASP.NET Core 2.0, and they follow a totally different approach from the rest of ASP.NET Core. Instead of the MVC pattern, Razor pages are self-contained files, similar to XAML controls or ASP.NET Web Forms, because they can also have a code-behind file. There is no longer a controller/view separation, as Razor pages have all they need in a single file although we can also specify a class for them.
To use Razor Pages, you need a compatible Visual Studio version, starting from 2017 Update 3, plus you need to have ASP.NET Core 2.0 or higher installed:
Razor Pages is physically stored in the filesystem, underneath aPagesfolder (this is by convention), and the pages should have the same.cshtmlextension as regular Razor views. What differentiates them is the new@pagedirective. This is shown with the following code:
@page
@model HelloWorldModel
<!DOCTYPE html>
<html>
<head>...