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 | 038e8dcf461d4d4ebd51c8fdf7680497869f691c (patch) | |
tree | dfd6ca1258d61ed91e59be620a39159919d07a3f /Timeline/Models/Http | |
parent | 5aaa4f95e6bdd46e6740c1ecbbd46bdf415eedd2 (diff) | |
download | timeline-038e8dcf461d4d4ebd51c8fdf7680497869f691c.tar.gz timeline-038e8dcf461d4d4ebd51c8fdf7680497869f691c.tar.bz2 timeline-038e8dcf461d4d4ebd51c8fdf7680497869f691c.zip |
...
Diffstat (limited to 'Timeline/Models/Http')
-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 });
}
}
|