This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Define crisp for semantics for what makes a pagemodel a pagemodel #6210
Closed
Description
Consider the following:
public class MyModel
{
[FromRoute]
public int Value { get; set; }
}
@page
@model MyModel
@functions {
public Task OnPostAsync(...) { ... } // Should this run?
}
Right now the decision depends on whether or not MyModel
has a handler method. This is kinda haphazard 😞
We need to define this semantic clearly.
Idea:
- Naming convention based on
*Model
naming - An attribute for a base class that says "all derived classes are pagemodels"
- Put that attribute on
PageModel
.
This is pretty similar to what we do for controllers and VCs