aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/ActionContextAccessorExtensions.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-04 00:40:19 +0800
committercrupest <crupest@outlook.com>2020-06-04 00:40:19 +0800
commit1e918584d1d11525ef7d13fef47fb5a9b84bd1b1 (patch)
treecc8bc62992b35397f334477b7a591993b00001b8 /Timeline/Models/Http/ActionContextAccessorExtensions.cs
parent1b9f4bfb2242589463c70b4ad2c77cfc8f79afb0 (diff)
downloadtimeline-1e918584d1d11525ef7d13fef47fb5a9b84bd1b1.tar.gz
timeline-1e918584d1d11525ef7d13fef47fb5a9b84bd1b1.tar.bz2
timeline-1e918584d1d11525ef7d13fef47fb5a9b84bd1b1.zip
chore(back): Fix some warnings.
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);
+ }
+ }
+}