aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-01-31 00:10:23 +0800
committercrupest <crupest@outlook.com>2020-01-31 00:10:23 +0800
commiteaf6d126db56b7caedd311033403b1f721bb80bc (patch)
treedfd6ca1258d61ed91e59be620a39159919d07a3f /Timeline/Models/Http
parent49bd47fb0eb81a88cce135f7ff7c25637790e63b (diff)
downloadtimeline-eaf6d126db56b7caedd311033403b1f721bb80bc.tar.gz
timeline-eaf6d126db56b7caedd311033403b1f721bb80bc.tar.bz2
timeline-eaf6d126db56b7caedd311033403b1f721bb80bc.zip
...
Diffstat (limited to 'Timeline/Models/Http')
-rw-r--r--Timeline/Models/Http/UserInfo.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Timeline/Models/Http/UserInfo.cs b/Timeline/Models/Http/UserInfo.cs
index 62d989a2..07ac0aad 100644
--- a/Timeline/Models/Http/UserInfo.cs
+++ b/Timeline/Models/Http/UserInfo.cs
@@ -31,11 +31,13 @@ namespace Timeline.Models.Http
public class UserInfoAvatarUrlValueResolver : IValueResolver<User, IUserInfo, string>
{
- private readonly IActionContextAccessor _actionContextAccessor;
- private readonly IUrlHelperFactory _urlHelperFactory;
+ private readonly IActionContextAccessor? _actionContextAccessor;
+ private readonly IUrlHelperFactory? _urlHelperFactory;
public UserInfoAvatarUrlValueResolver()
{
+ _actionContextAccessor = null;
+ _urlHelperFactory = null;
}
public UserInfoAvatarUrlValueResolver(IActionContextAccessor actionContextAccessor, IUrlHelperFactory urlHelperFactory)
@@ -51,7 +53,7 @@ namespace Timeline.Models.Http
return $"/users/{destination.Username}/avatar";
}
- var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);
+ var urlHelper = _urlHelperFactory!.GetUrlHelper(_actionContextAccessor.ActionContext);
return urlHelper.ActionLink(nameof(UserAvatarController.Get), nameof(UserAvatarController), new { destination.Username });
}
}