Ejemplo n.º 1
0
        internal MetalRouteContext MoveCapturedToParent(IMetalRoute parentRoute, IEnumerable <string> capturedSegments)
        {
            var currentCapturedSegments = CurrentSegments.TakeWhile((cseg, idx) => capturedSegments.ElementAtOrDefault(idx).EqualsIgnoreCase(cseg));

            if (currentCapturedSegments is null || !currentCapturedSegments.Any())
            {
                return(this);
            }

            return(new MetalRouteContext(
                       parentRoute,
                       ParentSegments.Concat(currentCapturedSegments),
                       CurrentSegments.Skip(currentCapturedSegments.Count())
                       ));
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return($"ParentSegments={ParentSegments.JoinPath()}, CurrentSegments={CurrentSegments.JoinPath()}");
 }