XML : C# deserialize xml array of different types into multiple arrays

I have the following xml:

  <Applications>      <AccessibleApplication></AccessibleApplication>      <AccessibleApplication></AccessibleApplication>      <EligibleApplication></EligibleApplication>      <EligibleApplication></EligibleApplication>  </Applications>    

Is there a way to deserialize this into a C# object so that the AccessibleApplications and EligibleApplications are two separate arrays? I tried the following but get an exception because "Applications" is used more than once.

  [XmlArray("Applications")]  [XmlElement("AccessibleApplication")]  public List<Application> AccessibleApplications { get; set; }    [XmlArray("Applications")]  [XmlElement("EligibleApplication")]  public List<Application> EligibleApplications { get; set; }    

Is this possible to do?

Thanks!

No comments:

Post a Comment