質問

これは簡単なはずですが、明らかに私はトリックを見逃しています。私はポコを持っています:

public class job
{
    public string title { get; set; }
    public string company { get; set; }
    public string companywebsite { get; set; }

    public string[] locations { get; set; }
}

私はそれをrestsharpを使用してXMLにシリアル化しています。どちらかを取得したいと思っています:

<job>
    <title>Hello title</title>
    <company>Hello company</company>
    <locations>New York</locations>
    <locations>Los Angeles</locations>
    <locations>Detroit</locations>
</job>

または理想的に...

<job>
    <title>Hello title</title>
    <company>Hello company</company>
    <locations>
         <location>New York</location>
         <location>Los Angeles</location>
         <location>Detroit</location>
    </locations>
</job>

しかし、代わりにこれを取得しています:

<job>
    <title>Hello title</title>
    <company>Hello company</company>
    <locations>
         <String />
         <String />
         <String />
    </locations>
</job>

明らかに、Pocoは異なる必要があります。私に何ができる?

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top