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
[x] How does {*path} routing work if the FormsController implements TopicController and MapTopicRoute()?
[x] Can a FollowUpPage nested under a FormPage be routed to the TopicController.Index() action?
[x] Update the IReverseTopicMappingService to support complex properties. E.g., [MapToParent(true)], with property name being relayed as the (optional) prefix via private MapAsync(ITopicBindingModel source, Topic target, string prefix).
[x] Emails will likely need to be sent via HTTP call. While rendering a view is possible, it’s likely not practical in a reusable format since we use a custom ViewResult.
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.
[x] Save form content as a new Topic via IReverseTopicMappingService
[x] Send form content as email via HttpContext.Request.Form
[x] Send “mail merged” email receipt to customer
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:
[x] AcademicInstructor
[x] AcademicStudent
[x] Demo
[x] Evaluation
[x] Newsletter
[x] Quote
[x] Training
[x] UserConference
Most of the logic for the forms will be defined in the form binding models (#10) and their corresponding views (#12).
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 aDictionary<>
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 rawHttpRequest.Form
content—or they can useReflection
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
{*path}
routing work if theFormsController
implementsTopicController
andMapTopicRoute()
?FollowUpPage
nested under aFormPage
be routed to theTopicController.Index()
action?IReverseTopicMappingService
to support complex properties. E.g.,[MapToParent(true)]
, with property name being relayed as the (optional) prefix viaprivate MapAsync(ITopicBindingModel source, Topic target, string prefix)
.ViewResult
.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.
Topic
viaIReverseTopicMappingService
HttpContext.Request.Form
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:AcademicInstructor
AcademicStudent
Demo
Evaluation
Newsletter
Quote
Training
UserConference
Most of the logic for the forms will be defined in the form binding models (#10) and their corresponding views (#12).