My model classes are:
public class Group
{
public Employee Employee {get;set;}
}
public class Employee {
public string Name {get;set;}
}
so after serialization my xml looks like this:
<Group>
<Employee>
<Name>Haley</Name>
</Employee>
</Group>
but I would like it to be:
<Group>
<Name>Haley</Name>
</Group>
So is there any attribute etc. to achieve that? I know I can do this using some code, but would be nice if there is some simplier solution. I saw the solution for lists and arrays (using [XmlElement] attribute), but looks like it doesn't work for non collection properties.