© Eric Vogel 2021
E. VogelBeginning Entity Framework Core 5https://doi.org/10.1007/978-1-4842-6882-7_20

20. Reporting on the Web

Eric Vogel1  
(1)
Okemos, MI, USA
 

In this chapter, I will show how to create a simple report that displays all person records in the database sorted by last name and then first name. We will be using Entity Framework Core 5 to aggregate the data and a custom Razor Page to display the report as an HTML table. After we have the report working, we’ll add pagination to it.

Creating the Razor Page

To get started, add a new folder under the Pages directory in your web project named “Reports”. Then add a new Razor Page template file named “PeopleReport.cshtml” as seen in Figure 20-1.
Figure 20-1

Adding a People Razor Page

This will ...

Get Beginning Entity Framework Core 5: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.