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
Consider the following:
Right now the decision depends on whether or not
MyModelhas a handler method. This is kinda haphazard 😞We need to define this semantic clearly.
Idea:
*ModelnamingPageModel.This is pretty similar to what we do for controllers and VCs