aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/ActionContextAccessorExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Models/Http/ActionContextAccessorExtensions.cs')
-rw-r--r--Timeline/Models/Http/ActionContextAccessorExtensions.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Timeline/Models/Http/ActionContextAccessorExtensions.cs b/Timeline/Models/Http/ActionContextAccessorExtensions.cs
new file mode 100644
index 00000000..bcc55c5a
--- /dev/null
+++ b/Timeline/Models/Http/ActionContextAccessorExtensions.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Infrastructure;
+using System;
+
+namespace Timeline.Models.Http
+{
+ public static class ActionContextAccessorExtensions
+ {
+ public static ActionContext AssertActionContextForUrlFill(this IActionContextAccessor accessor)
+ {
+ return accessor.ActionContext ?? throw new InvalidOperationException(Resources.Models.Http.Exception.ActionContextNull);
+ }
+ }
+}