private void FillSectionPerson(string code, ref ContactPerson sender, XmlNode requestXml) { foreach (var property in sender.GetType().GetFields()) { foreach (var childNode in requestXml.ChildNodes.Cast <XmlNode>().Where(childNode => childNode.Name == (code + property.Name) && childNode.ChildNodes.Count > 0)) { SetValueForProperty(property, sender, childNode.ChildNodes[0].Value); } } }
private void FillSectionPerson(string code, ref ContactPerson sender, XmlNode requestXml) { foreach (var property in sender.GetType().GetFields()) foreach (var childNode in requestXml.ChildNodes.Cast<XmlNode>().Where(childNode => childNode.Name == (code + property.Name) && childNode.ChildNodes.Count > 0)) SetValueForProperty(property, sender, childNode.ChildNodes[0].Value); }