Exemplo n.º 1
0
        public PsApiManagementRegion AddRegion(
            string location,
            PsApiManagementSku sku = PsApiManagementSku.Developer,
            int capacity           = 1,
            PsApiManagementVirtualNetwork virtualNetwork = null)
        {
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }

            if (location.Equals(Location) || AdditionalRegions.Any(r => location.Equals(r.Location)))
            {
                throw new ArgumentException(string.Format(Resources.AddRegionExistsMessage, location), "location");
            }

            var newRegion = new PsApiManagementRegion
            {
                Location       = location,
                Sku            = sku,
                Capacity       = capacity,
                VirtualNetwork = virtualNetwork
            };

            AdditionalRegions.Add(newRegion);

            return(newRegion);
        }
Exemplo n.º 2
0
        public PsApiManagementRegion AddRegion(
            string location,
            PsApiManagementSku sku = PsApiManagementSku.Developer,
            int capacity = 1,
            PsApiManagementVirtualNetwork virtualNetwork = null)
        {
            if (location == null)
            {
                throw new ArgumentNullException("location");
            }

            if (location.Equals(Location) || AdditionalRegions.Any(r => location.Equals(r.Location)))
            {
                throw new ArgumentException(string.Format(Resources.AddRegionExistsMessage, location), "location");
            }

            var newRegion = new PsApiManagementRegion
            {
                Location = location,
                Sku = sku,
                Capacity = capacity,
                VirtualNetwork = virtualNetwork
            };

            AdditionalRegions.Add(newRegion);

            return newRegion;
        }