start new route provider

This commit is contained in:
2021-10-05 15:50:12 +02:00
parent 53ac744be8
commit f861ccb7a2
9 changed files with 252 additions and 40 deletions
+25
View File
@@ -0,0 +1,25 @@
using zero.Core.Routing;
namespace zero.Core.Extensions
{
public static class RouteExtensions
{
public static Route DependsOn(this Route route, string id)
{
route.Dependencies.Add(id);
return route;
}
public static Route Param(this Route route, string key, object value)
{
route.Params[key] = value;
return route;
}
public static Route Reference(this Route route, string id, string collection)
{
route.References.Add(new(id, collection));
return route;
}
}
}