internal string GetValueForField()

in WEB/Src/WindowsServer/WindowsServer/Implementation/DataContracts/AzureInstanceComputeMetadata.cs [74:137]


        internal string GetValueForField(string fieldName)
        {
            string aimsValue = null;
            switch (fieldName.ToLowerInvariant())
            {
                case "ostype":
                    aimsValue = this.OsType;
                    break;
                case "location":
                    aimsValue = this.Location;
                    break;
                case "name":
                    aimsValue = this.Name;
                    break;
                case "offer":
                    aimsValue = this.Offer;
                    break;
                case "placementgroupid":
                    aimsValue = this.PlacementGroupId;
                    break;
                case "platformfaultdomain":
                    aimsValue = this.PlatformFaultDomain;
                    break;
                case "platformupdatedomain":
                    aimsValue = this.PlatformUpdateDomain;
                    break;
                case "publisher":
                    aimsValue = this.Publisher;
                    break;
                case "sku":
                    aimsValue = this.Sku;
                    break;
                case "version":
                    aimsValue = this.Version;
                    break;
                case "vmid":
                    aimsValue = this.VmId;
                    break;
                case "vmsize":
                    aimsValue = this.VmSize;
                    break;
                case "subscriptionid":
                    aimsValue = this.SubscriptionId;
                    break;
                case "resourcegroupname":
                    aimsValue = this.ResourceGroupName;
                    break;
                case "tags":
                    aimsValue = this.Tags;
                    break;
                case "vmscalesetname":
                    aimsValue = this.VmScaleSetName;
                    break;
                default:
                    throw new ArgumentOutOfRangeException(string.Format(CultureInfo.InvariantCulture, "No field named '{0}' in AzureInstanceComputeMetadata.", fieldName));
            }

            if (aimsValue == null)
            {
                aimsValue = string.Empty;
            }

            return aimsValue;
        }