コード例 #1
0
        private static List <DnsRecordBase> GetPowerShellRecords <T>(IList <T> mamlObjects) where T : class
        {
            var result = new List <DnsRecordBase>();

            if (mamlObjects == null || mamlObjects.Count == 0)
            {
                return(result);
            }

            return(mamlObjects.Select(mamlObject => DnsRecordBase.FromMamlRecord(mamlObject)).ToList());
        }
コード例 #2
0
        private static List <DnsRecordBase> GetPowerShellRecords(Management.Dns.Models.RecordSet recordSet)
        {
            var result = new List <DnsRecordBase>();

            result.AddRange(GetPowerShellRecords(recordSet.Properties.AaaaRecords));
            result.AddRange(GetPowerShellRecords(recordSet.Properties.ARecords));
            result.AddRange(GetPowerShellRecords(recordSet.Properties.MxRecords));
            result.AddRange(GetPowerShellRecords(recordSet.Properties.NsRecords));
            result.AddRange(GetPowerShellRecords(recordSet.Properties.SrvRecords));
            result.AddRange(GetPowerShellRecords(recordSet.Properties.TxtRecords));
            if (recordSet.Properties.CnameRecord != null)
            {
                result.Add(DnsRecordBase.FromMamlRecord(recordSet.Properties.CnameRecord));
            }
            if (recordSet.Properties.SoaRecord != null)
            {
                result.Add(DnsRecordBase.FromMamlRecord(recordSet.Properties.SoaRecord));
            }

            return(result);
        }