18 lines
509 B
C#
18 lines
509 B
C#
using ApplicationHub.Domain.Contracts.Authentication;
|
|
using ApplicationHub.Domain.Contracts.Authentication.Models;
|
|
using AutoMapper;
|
|
|
|
namespace ApplicationHub.Data.InMemory.Authentication;
|
|
|
|
public class UserDataContext(IMapper mapper) : IUserRepository
|
|
{
|
|
public User? GetUserByUserName(string userName)
|
|
{
|
|
var result = UserData.Source
|
|
.Where(x => x.UserName == userName && x.Active)
|
|
.ToList();
|
|
return mapper.Map<List<User>>(result).FirstOrDefault();
|
|
}
|
|
}
|
|
|