GenHTTP
GenHTTP copied to clipboard
Add framework to develop model-based pages
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