Example #1
0
        private PSManagedNetwork CreateManagedNetwork()
        {
            PSManagedNetwork psManagedNetwork = new PSManagedNetwork()
            {
                Scope = this.Scope ?? new PSScope(),
                Tags  = this.Tags ?? new List <string>()
            };

            var sdkManagedNetwork = ManagedNetworkResourceManagerProfile.Mapper.Map <ManagedNetworkModel>(psManagedNetwork);
            var putSdkResponse    = this.ManagedNetworkManagementClient.ManagedNetworks.CreateOrUpdate(sdkManagedNetwork, this.ResourceGroupName, this.Name);
            var putPSResponse     = ManagedNetworkResourceManagerProfile.Mapper.Map <PSManagedNetwork>(putSdkResponse);

            return(putPSResponse);
        }
Example #2
0
        private PSManagedNetwork CreateManagedNetwork()
        {
            IDictionary <string, string> tagDir = new Dictionary <string, string>();

            if (this.Tag != null)
            {
                tagDir = this.Tag.Cast <DictionaryEntry>().ToDictionary(table => (string)table.Key, table => (string)table.Value);
            }
            PSManagedNetwork psManagedNetwork = new PSManagedNetwork()
            {
                Scope    = this.Scope ?? new PSScope(),
                Location = this.Location,
                Tags     = tagDir
            };
            var sdkManagedNetwork = ManagedNetworkResourceManagerProfile.Mapper.Map <ManagedNetworkModel>(psManagedNetwork);
            var putSdkResponse    = this.ManagedNetworkManagementClient.ManagedNetworks.CreateOrUpdate(sdkManagedNetwork, this.ResourceGroupName, this.Name);
            var putPSResponse     = ManagedNetworkResourceManagerProfile.Mapper.Map <PSManagedNetwork>(putSdkResponse);

            return(putPSResponse);
        }