[XmlRoot(ElementName="api_response")]
public class ApiResponse
{
[XmlElement( ElementName = "api_name")]
public string api_name { get; set; }
}
Above is a class with specified class
I want to change ElementName="api_response"
api_response value to dynamic values like
some time it should be
ElementName="first response"
or
ElementName="second response"
I have to change this dynamically
I have tried some thing like this but dint get worked out
XmlAttributeOverrides config1 = new XmlAttributeOverrides();
config1.Add(typeof(ORM.ApiResponse), "ElementName",new XmlAttributes {XmlDefaultValue = "myvalue" };
but its not working
please help
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…