Beispiel #1
0
        /// <summary>
        /// Returns the YAML representation of a <see cref="Zone"/>.
        /// </summary>
        public static string ToYaml(this Zone zone)
        {
            if (zone == null)
            {
                throw new ArgumentNullException(nameof(zone));
            }

            var writer = new StringWriter();

            return(writer.SerializeYaml(zone).ToString());
        }
Beispiel #2
0
        /// <summary>
        /// Returns the YAML representation of a collection of <see cref="DnsRecord"/>.
        /// </summary>
        public static string ToYaml(this IEnumerable <DnsRecord> dnsRecords, string containerName = null)
        {
            if (dnsRecords == null)
            {
                throw new ArgumentNullException(nameof(dnsRecords));
            }

            var writer = new StringWriter();

            return(writer.SerializeYaml(dnsRecords, containerName).ToString());
        }