Skip to content

Commit 5751fdc

Browse files
committed
Adds extension methods to enable and disable routes
1 parent a442131 commit 5751fdc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Grapevine/IRoute.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,19 @@ public interface IRoute : IRouteProperties
1313

1414
IRoute WithHeader(string header, Regex pattern);
1515
}
16+
17+
public static class IRouteExtensions
18+
{
19+
public static IRoute Disable(this IRoute route)
20+
{
21+
route.Enabled = false;
22+
return route;
23+
}
24+
25+
public static IRoute Enable(this IRoute route)
26+
{
27+
route.Enabled = true;
28+
return route;
29+
}
30+
}
1631
}

0 commit comments

Comments
 (0)