aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/UserInfo.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/UserInfo.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/UserInfo.cs')
-rw-r--r--Timeline/Models/Http/UserInfo.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Timeline/Models/Http/UserInfo.cs b/Timeline/Models/Http/UserInfo.cs
index b4bf14c1..0acb1a80 100644
--- a/Timeline/Models/Http/UserInfo.cs
+++ b/Timeline/Models/Http/UserInfo.cs
@@ -37,10 +37,9 @@ namespace Timeline.Models.Http
public UserInfoLinks Resolve(User source, UserInfo destination, UserInfoLinks destMember, ResolutionContext context)
{
- if (_actionContextAccessor.ActionContext == null)
- throw new InvalidOperationException("No action context, can't fill urls.");
+ var actionContext = _actionContextAccessor.AssertActionContextForUrlFill();
+ var urlHelper = _urlHelperFactory.GetUrlHelper(actionContext);
- var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);
var result = new UserInfoLinks
{
Self = urlHelper.ActionLink(nameof(UserController.Get), nameof(UserController)[0..^nameof(Controller).Length], new { destination.Username }),