public static OutboundRouteDefinition Create(RouteSourceType type, string template)
        {
            var route = new OutboundRouteDefinition(type, template);

            route.Validate();
            return(route);
        }
        public object Create(object parent, object configContext, XmlNode section)
        {
            var configuration = new RoutingConfiguration();

            configuration.InboundRoutes.AddRange(section
                                                 .OfType <XmlElement>()
                                                 .Where(x => "inboundRoute".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
                                                 .Select(route => InboundRouteDefinition.Create(
                                                             route.OfType <XmlElement>().Where(x => "template".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).Select(x => x.InnerText),
                                                             ParseInboundRouteType(route.GetAttribute("to")))));
            configuration.OutboundRoutes.AddRange(section
                                                  .OfType <XmlElement>()
                                                  .Where(x => "outboundRoute".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
                                                  .Select(route => OutboundRouteDefinition.Create(
                                                              ParseOutboundRouteType(route.GetAttribute("from")),
                                                              route.OfType <XmlElement>().Single(x => "template".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).InnerText)));
            return(configuration);
        }
 public static OutboundRouteDefinition Create(RouteSourceType type, string template)
 {
     var route = new OutboundRouteDefinition(type, template);
     route.Validate();
     return route;
 }