C# 序列化xsi:type

public class FooClass
{
    public int FooPropertyA { get; set; }
    public string FooPropertyB { get; set; }
 
    [XmlAttribute("type",Namespace="http://www.w3.org/2001/XMLSchema-instance")]
    public string XsiType
    {
        get { return "Foo"; }
        set { }
    }
}

 

posted @ 2020-09-09 14:26  Tozhang  阅读(456)  评论(0)    收藏  举报