Files
mixtape/zero.Core/Extensions/RouteExtensions.cs
T
2021-10-05 15:50:12 +02:00

26 lines
546 B
C#

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;
}
}
}