diff --git a/main/src/ReCode.Cocoon.Proxy/Proxy/BlazorRouteDiscovery.cs b/main/src/ReCode.Cocoon.Proxy/Proxy/BlazorRouteDiscovery.cs index 874bcfc..c9d78d4 100644 --- a/main/src/ReCode.Cocoon.Proxy/Proxy/BlazorRouteDiscovery.cs +++ b/main/src/ReCode.Cocoon.Proxy/Proxy/BlazorRouteDiscovery.cs @@ -1,7 +1,8 @@ -using System; +using Microsoft.AspNetCore.Components; +using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; -using Microsoft.AspNetCore.Components; namespace ReCode.Cocoon.Proxy.Proxy { @@ -14,11 +15,15 @@ public static IEnumerable FindRoutes(Type type) { if (exportedType.BaseType?.Name == "ComponentBase") { - var routeAttribute = exportedType - .GetCustomAttribute(typeof(RouteAttribute)) - as RouteAttribute; - if (routeAttribute is null) continue; - yield return routeAttribute.Template; + // fix #31 - support multiple routeAttribute values + var routeAttributes = exportedType.GetCustomAttributes(typeof(RouteAttribute)) + .Select(a => a as RouteAttribute); + if (!routeAttributes.Any()) continue; + foreach (var routeAttribute in routeAttributes) + { + if (routeAttribute != null) + yield return routeAttribute.Template; + } } } }