using Microsoft.AspNetCore.Mvc.RazorPages;
public class IndexModel : PageModel
{
private readonly CustomerRepository _customerRepository;
public IndexModel(CustomerRepository customerRepository)
{
_customerRepository = customerRepository;
@model (dynamic, RazorPagesContacts.Pages.Customers.IndexModel)
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!-- Option 1: use ViewData -->
<div>
<h1>@((MyNamespace.MyModel1)ViewData["Model1"]).Title</h1>
<p>@((MyNamespace.MyModel1)ViewData["Model1"]).Content</p>
</div>
using Microsoft.AspNetCore.Mvc;
using YourNamespace.Models;
namespace YourNamespace.Controllers
{
public class MyController : Controller
{
private readonly IMyRepository _myRepository;