Skip to content
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

@rynowak

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

Activity

  1. added this to the 2.0.0-preview2 milestone on Apr 26, 2017
  2. rynowak commented on May 19, 2017

    @rynowak
    ContributorAuthor

    No one has complained.. Let's move this to preview3

  3. modified the milestones: , 2.0.0-preview2 on May 19, 2017
  4. self-assigned this
    on May 19, 2017
  5. Eilon commented on Jun 9, 2017

    @Eilon
    Contributor

    Discussed with @rynowak and we think that we should drop the naming convention for now.

    We should just use the attribute, or any base class that has the attribute.

  6. added a commit that references this issue on Jun 28, 2017
    79abfe6
  7. added a commit that references this issue on Jun 29, 2017
    e4e0438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions