added findByUserNameAsync to the interface and service
This commit is contained in:
@@ -21,6 +21,24 @@ public class IdentityService(
|
||||
|
||||
return user?.UserName;
|
||||
}
|
||||
|
||||
public async Task<UserModel?> GetUserByUserNameAsync(string userName)
|
||||
{
|
||||
var response = await userManager.FindByNameAsync(userName);
|
||||
|
||||
if (response == null) return null;
|
||||
|
||||
var userModel = new UserModel()
|
||||
{
|
||||
Id = response.Id,
|
||||
UserName = response.UserName,
|
||||
FirstName = response.FirstName,
|
||||
LastName = response.LastName,
|
||||
Email = response.Email,
|
||||
};
|
||||
|
||||
return userModel;
|
||||
}
|
||||
|
||||
public async Task<(Result Result, string UserId)> CreateUserAsync(string userName, string password)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user