C# .net核心自定义modebinder多病态问题

C# .net核心自定义modebinder多病态问题,c#,.net-core,C#,.net Core,当我试图用ajax和模型绑定器发送表单以创建我的动作模型时,遇到了一个问题 问题是,当活页夹从Request.Form获取特定值时,如下所示: public class A { public string property1 {get;set;} public string property2 {get;set;} } public class B { public A[] A {get;set;} } A[0]。property1=“测试” A[0]。propert

当我试图用ajax和模型绑定器发送表单以创建我的动作模型时,遇到了一个问题

问题是,当活页夹从Request.Form获取特定值时,如下所示:

public class A {
    public string property1 {get;set;}
    public string property2 {get;set;}
}

public class B {
    public A[] A {get;set;}
}
A[0]。property1=“测试”

A[0]。property2=“test2”

类是这样的:

public class A {
    public string property1 {get;set;}
    public string property2 {get;set;}
}

public class B {
    public A[] A {get;set;}
}
问题:如何将[0].property1和[0].property2序列化为:[{property1:“测试”,property2:“测试2”}]