diff options
author | crupest <crupest@outlook.com> | 2020-01-31 00:10:23 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 00:10:23 +0800 |
commit | eaf6d126db56b7caedd311033403b1f721bb80bc (patch) | |
tree | dfd6ca1258d61ed91e59be620a39159919d07a3f /Timeline/Models/Http/UserInfo.cs | |
parent | 49bd47fb0eb81a88cce135f7ff7c25637790e63b (diff) | |
download | timeline-eaf6d126db56b7caedd311033403b1f721bb80bc.tar.gz timeline-eaf6d126db56b7caedd311033403b1f721bb80bc.tar.bz2 timeline-eaf6d126db56b7caedd311033403b1f721bb80bc.zip |
...
Diffstat (limited to 'Timeline/Models/Http/UserInfo.cs')
-rw-r--r-- | Timeline/Models/Http/UserInfo.cs | 8 |
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 });
}
}
|