GenHTTP icon indicating copy to clipboard operation
GenHTTP copied to clipboard

Add framework to develop model-based pages

Open Kaliumhexacyanoferrat opened this issue 4 years ago • 0 comments

As a developer, I would like to add web pages with additional logic in their model classes, so that I can handle situations like submitted data.

Example

var page = Page.Create<SomeModel>(ScribanView.From("someview.html"));

public class SomeModel : PageModel
{
  public string MyProperty { get; }

  public void OnPost() 
  {
    // ...
  }
}

Acceptance criteria

  • The framework is available as a separate nuget package
  • The framework allows to work with views from different rendering engines (e.g. #48)
  • There is an additional router which allows to specify a whole directory with view files
  • The framework aligns with Razor Pages where appropriate to keep the learning curve low

Kaliumhexacyanoferrat avatar Mar 04 '20 22:03 Kaliumhexacyanoferrat