I am following the document https://doc.sitecore.com/developers/100/developer-tools/en/walkthrough--using-the-getting-started-template.html to create a test sample project for Sitecore Headless Development.
Everything is working perfectly and I got an understanding of how the PageModel is automatically bound with the requested page.
public IActionResult Index(PageModel page)
And how the component model is being registered.
.AddModelBoundView<ContentBlockModel>("ContentBlock")
And how it is being used in views.
@model ContentBlockModel
but I have some different requirements. I want to get ContentBlockModel directly from the page route something like
ContentBlockModel contenBlockModel = page.Route.Placeholders["myproject-main"][0]
Is there any way to get ContentBlockModel from PageModel directly?