ASPNet Core Web App – RazorPages Concept

Hi,

To, I’m going to share about Razor Page concept in Web Programming

Razor Page Concept (1/3)

Diagram below describes the concept of Razor Page. You can see the relations between Data Model, Razor Page, and Page Model. Razor Page is similar to View in MVC (Model, View, Controller) concept, and Page Model is similar to Controller in MVC concept.

Razor Page Concept 1/3

Razor Page Concept (2/3)

Diagram below shows the steps of creating Razor Page application using scaffold process. You just need to define data model (Model) and let the scaffold process to automatically create a related Page Model and related CRUD (Create, Read, Update and Delete) Razor Page / Razor Views based on the data Model you created. Data Migration process allows creation of database related tables automatically.

Razor Page Concept 2/3

Razor Page Concept (3/3)

Diagram below shows a more detail relationships between Razor Page (Data Model, Razor Page / Razor View and Page Model), as well as DBContext and Migration classes. It also describes the project files within Visual Studio solution.

Razor Page Concept 3/3

I hope above visualization of Razor Page concept can help you understand the basic of Razor Page concept.

Cheers

Leave a comment