GoldSim / Website

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

Create Form Controller with Feature Actions #11

Closed JeremyCaney closed 4 years ago

JeremyCaney commented 4 years ago

Establish an ASP.NET Core 3.0 controller to handle the routing and processing of form requests.

Current Approach

In the current ASP.NET WebForms version of the GoldSim forms, there are a number of helper functions in the master template that are called by each form. These serialize the Request.Form data into a Dictionary<> and then use that to perform a series of actions, such as sending an email.

New Approach

In the ASP.NET Core version, these helper functions will become actions on a new FormsController class. These can continue to rely on raw HttpRequest.Form content—or they can use Reflection to loop over the properties of the binding model. Regardless, the content of the actions should remain largely the same, with some minor adjustments to accommodate changes to the .NET Core API.

Research

Feature Actions

Feature actions support the basic functionality of the form processing. New feature actions can be added in the future, as necessary, to extend the form behavior.

Routing Actions

Routing actions map to individual forms. The [get] action maps a route to a view; the [post] action composes a series of feature actions to process the customer request. These include:

Most of the logic for the forms will be defined in the form binding models (#10) and their corresponding views (#12).