我遇到了一个场景,我会得到很多基于form.io Javasrcipt的JSON对象来一个Controller。我如何生成 C# 类以便它们可以是强类型的?
JavaScript 类:
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 对象:
{
"input":true,
"key":"inputElement"
}
接收的控制器:
public IActionResult Receiver(???) // strongly typed for many kinds of JSON?
{
return View();
}