How to add XmlInclude attribute dynamically

后端 未结 4 1713
青春惊慌失措
青春惊慌失措 2020-11-27 05:20

I have the following classes

[XmlRoot]
public class AList
{
   public List ListOfBs {get; set;}
}

public class B
{
   public string BaseProperty {g         


        
4条回答
  •  时光说笑
    2020-11-27 05:29

    Have a look at the documentation of XmlSerializer. There is a constructor which expects known types as the second parameter. That should work fine for you use case.

提交回复
热议问题