diff options
author | crupest <crupest@outlook.com> | 2020-06-04 00:40:19 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-04 00:40:19 +0800 |
commit | 1e918584d1d11525ef7d13fef47fb5a9b84bd1b1 (patch) | |
tree | cc8bc62992b35397f334477b7a591993b00001b8 /Timeline/Models/Http/ActionContextAccessorExtensions.cs | |
parent | 1b9f4bfb2242589463c70b4ad2c77cfc8f79afb0 (diff) | |
download | timeline-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.cs | 14 |
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);
+ }
+ }
+}
|