GoldSim / Website

Source code for the GoldSim.com website
https://www.goldsim.com/
3 stars 1 forks source link

Create Form Binding Models #10

Closed JeremyCaney closed 4 years ago

JeremyCaney commented 4 years ago

The current forms rely on ASP.NET WebForms to loop through the Request.Form collection to process form values. In ASP.NET Core (as well as ASP.NET MVC Framework) the preferred approach is to instead map this input to binding models.

ASP.NET Core 3.0 Support

In ASP.NET Core 3.0 this also allows easy configuration of form validation and error messaging through the use of attributes.

Approach

There is a lot of overlap between the various GoldSim forms. Given this, a layered approach to creating binding models based on reusable POCOs is preferred. This allows new forms to be easily composed, without limiting extensibility.

Models

Binding Models

For more information, see the GoldSim.DotNetCore.Forms.DataModel.txt file.