I don’t think that the RazorPages are anything like WebForms. From my understanding the RazorPages use the Controller Principle but for one page only. So instead of creating a Contact Controller and creating the Index method and the Post of the form. You create a unified Razor file with a backing cs class that will handle get, post, put, patch, delete HTTP Verbs.
So from my point of view the OnGet is just your index method.