コード例 #1
0
        public static ResourceGroupReference FromHashtable(Hashtable hashtable)
        {
            var index  = PSRuleOption.BuildIndex(hashtable);
            var option = new ResourceGroupReference();

            if (index.TryPopValue("Name", out string svalue))
            {
                option.Name = svalue;
            }

            if (index.TryPopValue("Location", out svalue))
            {
                option.Location = svalue;
            }

            if (index.TryPopValue("ManagedBy", out svalue))
            {
                option.ManagedBy = svalue;
            }

            if (index.TryPopValue("ProvisioningState", out svalue))
            {
                option.ProvisioningState = svalue;
            }

            if (index.TryPopValue("Tags", out Hashtable tags))
            {
                option.Tags = tags;
            }

            return(option);
        }
コード例 #2
0
        public static SubscriptionReference FromHashtable(Hashtable hashtable)
        {
            var index  = PSRuleOption.BuildIndex(hashtable);
            var option = new SubscriptionReference();

            if (index.TryPopValue("SubscriptionId", out string svalue))
            {
                option.SubscriptionId = svalue;
            }

            if (index.TryPopValue("TenantId", out svalue))
            {
                option.TenantId = svalue;
            }

            if (index.TryPopValue("DisplayName", out svalue))
            {
                option.DisplayName = svalue;
            }

            if (index.TryPopValue("State", out svalue))
            {
                option.State = svalue;
            }

            return(option);
        }