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
commit189214cae17d6255989529ff47b2d963ed4c1038 (patch)
tree5e8010143dcc151dea369dd786cf060acc0c3fe4 /Timeline/Models/Http/ActionContextAccessorExtensions.cs
parente0f80f02ff60e901a20713d906ff212700861863 (diff)
downloadtimeline-189214cae17d6255989529ff47b2d963ed4c1038.tar.gz
timeline-189214cae17d6255989529ff47b2d963ed4c1038.tar.bz2
timeline-189214cae17d6255989529ff47b2d963ed4c1038.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);
+ }
+ }
+}