Microsoft.Azure.Commands.Network.SetAzureRouteTableCommand.Execute C# (CSharp) Method

Execute() public method

public Execute ( ) : void
return void
        public override void Execute()
        {

            base.Execute();
            if (!this.IsRouteTablePresent(this.RouteTable.ResourceGroupName, this.RouteTable.Name))
            {
                throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound);
            }

            // Map to the sdk object
            var routeTableModel = Mapper.Map<MNM.RouteTable>(this.RouteTable);
            routeTableModel.Tags = TagsConversionHelper.CreateTagDictionary(this.RouteTable.Tag, validate: true);

            // Execute the PUT RouteTable call
            this.RouteTableClient.CreateOrUpdate(this.RouteTable.ResourceGroupName, this.RouteTable.Name, routeTableModel);

            var getRouteTable = this.GetRouteTable(this.RouteTable.ResourceGroupName, this.RouteTable.Name);
            WriteObject(getRouteTable);
        }
    }
SetAzureRouteTableCommand