I've run into a scenario where I would get lot of form.io Javasrcipt based JSON objects to come to a Controller. How could I generate C# classes so that they could be strong typed?
JavaScript Classes:
export default class SomeComponent {
static schema(...sources) {
return _.merge({
/**
* Determines if this component provides an input.
*/
input: true,
/**
* The data key for this component (how the data is stored in the database).
*/
key: '',
...
}
JSON object that goes to the controller:
{
"input":true,
"key":"inputElement"
}
The controller that receives:
public IActionResult Receiver(???) // strongly typed for many kinds of JSON?
{
return View();
}