0
나는 아래 나열된 xml 있습니다. C#에서 <리스트로 deserialize하고 싶습니다. 목록 엔티티 이름 ASIwizard 및 마법사를 두 번 처리하는 방법이 있습니까? 그냥 ASIwizard 또는 마법사라면 할 수 있지만 각 요소에 이중 entitiy 이름이 있다면 어떻게 해야할지 잘 모르겠습니다.중복 엔티티 이름이있는 목록을 어떻게 deserialize합니까?
<ASiwizards>
<ASiwizard>
<Wizard>
<id>1</id>
<title>Headlight Wizard</title>
<description>This wizard will help troubleshoot issues related to the headlight functionality of the eBike controller</description>
<created>2012-04-27 14:35:34</created>
<modified>2012-04-27 14:35:34</modified>
</Wizard>
</ASiwizard>
<ASiwizard>
<Wizard>
<id>2</id>
<title>Wiring Harness</title>
<description/>
<created>2012-04-27 19:11:33</created>
<modified>2012-04-27 19:11:33</modified>
</Wizard>
</ASiwizard>
</ASiwizards>
당신은 내가이 공용 클래스 ASiwizards { [XMLELEMENT ("마법사")] 공개 목록에 추가 할 수 뭔지 알아 마법사; } 네임 스페이스 WizardList { 공용 클래스 마법사 { public int id; public String title; public String description; } } –
DonRobb
@DonRobb : 질문을 명확히하기 위해 업데이트해야합니다. 그것은 당신이'XmlSerializer'를 사용하고자하는 것 같으며 당신이 주석에 쓴 스 니펫을 추가해야합니다. 아마 내 대답을 삭제해야 할 것입니다. –