In Asp.net core 2 Razor pages, I want to render a Razor page with a model, and save it to a string. The intention is to send the string as an email (the rendered page is an invoice).
I found this for traditional MVC
https://ppolyzos.com/2016/09/09/asp-net-core-render-view-to-string/
But how to do that with a razor page?