Initial commit
This commit is contained in:
parent
858c1bebd2
commit
5556ca85f4
2 changed files with 4 additions and 9 deletions
|
@ -23,5 +23,5 @@ public interface IUserService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">User id.</param>
|
/// <param name="userId">User id.</param>
|
||||||
/// <returns>Instance of <see cref="UserDto" />, or null if not found.</returns>
|
/// <returns>Instance of <see cref="UserDto" />, or null if not found.</returns>
|
||||||
Task<UserDto> FindById(string userId);
|
Task<UserDto> FindById(Guid userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class UserService : IUserService
|
||||||
/// <param name="createUserValidator">Instance of <see cref="CreateUserValidator" />.</param>
|
/// <param name="createUserValidator">Instance of <see cref="CreateUserValidator" />.</param>
|
||||||
/// <param name="registrationConfig">Instance of <see cref="IOptions{RegistrationOptions}" />.</param>
|
/// <param name="registrationConfig">Instance of <see cref="IOptions{RegistrationOptions}" />.</param>
|
||||||
/// <param name="transactionProvider">Instance of <see cref="ITransactionProvider" />.</param>
|
/// <param name="transactionProvider">Instance of <see cref="ITransactionProvider" />.</param>
|
||||||
/// <param name="transactionProvider">Instance of <see cref="ITransactionProvider" />.</param>
|
/// <param name="userProfileRepository">Instance of <see cref="IUserProfileRepository" />.</param>
|
||||||
/// <param name="logger">Instance of <see cref="ILogger" />.</param>
|
/// <param name="logger">Instance of <see cref="ILogger" />.</param>
|
||||||
public UserService(
|
public UserService(
|
||||||
IUserRepository userRepository,
|
IUserRepository userRepository,
|
||||||
|
@ -154,14 +154,9 @@ public class UserService : IUserService
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public async Task<UserDto> FindById(string userId)
|
public async Task<UserDto> FindById(Guid userId)
|
||||||
{
|
{
|
||||||
if (!Guid.TryParse(userId, out var userGuid))
|
var user = await _userRepository.FindByIdAsync(userId);
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var user = await _userRepository.FindByIdAsync(userGuid);
|
|
||||||
|
|
||||||
return _mapper.Map<UserDto>(user);
|
return _mapper.Map<UserDto>(user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue