-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_ser.linq
More file actions
29 lines (25 loc) · 735 Bytes
/
xml_ser.linq
File metadata and controls
29 lines (25 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<Query Kind="Program" />
void Main()
{
var el = new Element() {
param = "elvis",
set = "foo"
};
var xs = new System.Xml.Serialization.XmlSerializer(typeof(Element));
var sw = new StringWriter();
xs.Serialize(sw, el);
sw.ToString().Dump();
}
// Define other methods and classes here
[System.Xml.Serialization.XmlType("element")]
public class Element
{
[System.Xml.Serialization.XmlElement(IsNullable = true)]
public string param { get; set; }
[System.Xml.Serialization.XmlElement(IsNullable = true)]
public string set { get; set; }
[System.Xml.Serialization.XmlAttribute("param")]
public string paramAttr { get; set; }
[System.Xml.Serialization.XmlAttribute("set")]
public string setAttr { get; set; }
}