private string GetXmlNodeName(Type type, LinkedNode<object> ancestors, PropertyInfo sourceProperty, Type itemType) { return sourceProperty != null && itemType == null ? sourceProperty.GetXmlName() : (sourceProperty.GetXmlArrayItemName() ?? type.GetXmlName(_options.GenericTypeXmlNameFormat, _options.GenericListXmlNameFormat, !ancestors.Any())); }
private static string GetJsonNodeName(LinkedNode<object> ancestors, PropertyInfo sourceProperty, Type itemType) { return !ancestors.Any() ? "root" : (itemType != null ? "item" : sourceProperty.GetXmlName()); }