Element() публичный Метод

public Element ( string elementName ) : System.Xml.Linq.XElement
elementName string
Результат System.Xml.Linq.XElement
Пример #1
0
        private void ExportRouteSettings(ExportContentContext context, CacheSettingsPart part)
        {
            var routes = _cacheService.GetRouteConfigs();
            var routesElement = new XElement("Routes",
                routes.Select(x => new XElement("Route")
                    .Attr("Key", x.RouteKey)
                    .Attr("Url", x.Url)
                    .Attr("Priority", x.Priority)
                    .Attr("Duration", x.Duration)
                    .Attr("GraceTime", x.GraceTime)
                    .Attr("MaxAge", x.MaxAge)
                    .Attr("FeatureName", x.FeatureName)));

            context.Element(part.PartDefinition.Name).Add(routesElement);
        }