diff options
author | crupest <crupest@outlook.com> | 2020-01-31 21:57:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 21:57:09 +0800 |
commit | 3749a642306b19c84f324b0e94c4d62d8ec60332 (patch) | |
tree | 9039ebf7eb7a21d2e57bbe928e43bf39a42473b1 /Timeline/Models | |
parent | a7fd42ddee50a8066a083c57b7940e4f9896dcb7 (diff) | |
download | timeline-3749a642306b19c84f324b0e94c4d62d8ec60332.tar.gz timeline-3749a642306b19c84f324b0e94c4d62d8ec60332.tar.bz2 timeline-3749a642306b19c84f324b0e94c4d62d8ec60332.zip |
Fix test bugs in user info mapper. Make create user action return created user info.
Diffstat (limited to 'Timeline/Models')
-rw-r--r-- | Timeline/Models/Http/UserInfo.cs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Timeline/Models/Http/UserInfo.cs b/Timeline/Models/Http/UserInfo.cs index fee53ade..0d1d702b 100644 --- a/Timeline/Models/Http/UserInfo.cs +++ b/Timeline/Models/Http/UserInfo.cs @@ -25,14 +25,8 @@ namespace Timeline.Models.Http public class UserInfoLinksValueResolver : IValueResolver<User, UserInfo, UserInfoLinks?>
{
- private readonly IActionContextAccessor? _actionContextAccessor;
- private readonly IUrlHelperFactory? _urlHelperFactory;
-
- public UserInfoLinksValueResolver()
- {
- _actionContextAccessor = null;
- _urlHelperFactory = null;
- }
+ private readonly IActionContextAccessor _actionContextAccessor;
+ private readonly IUrlHelperFactory _urlHelperFactory;
public UserInfoLinksValueResolver(IActionContextAccessor actionContextAccessor, IUrlHelperFactory urlHelperFactory)
{
@@ -42,10 +36,8 @@ namespace Timeline.Models.Http public UserInfoLinks? Resolve(User source, UserInfo destination, UserInfoLinks? destMember, ResolutionContext context)
{
- if (_actionContextAccessor == null || _urlHelperFactory == null)
- {
+ if (_actionContextAccessor.ActionContext == null)
return null;
- }
var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);
var result = new UserInfoLinks
|