public bool IsRouteFilterRulePresent(PSRouteFilter filter, string name) { var rule = filter.Rules.SingleOrDefault(resource => string.Equals(resource.Name, name, System.StringComparison.CurrentCultureIgnoreCase)); if (rule != null) { return(true); } return(false); }
private PSRouteFilter CreateRouteFilter() { var psRouteFilter = new PSRouteFilter(); psRouteFilter.Name = this.Name; psRouteFilter.ResourceGroupName = this.ResourceGroupName; psRouteFilter.Location = this.Location; psRouteFilter.Rules = this.Rule; // Map to the sdk object var routeFilterModel = NetworkResourceManagerProfile.Mapper.Map <MNM.RouteFilter>(psRouteFilter); routeFilterModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); // Execute the Create RouteTable call this.RouteFilterClient.CreateOrUpdate(this.ResourceGroupName, this.Name, routeFilterModel); var getRouteFilter = this.GetRouteFilter(this.ResourceGroupName, this.Name); return(getRouteFilter); }