using ApplicationHub.Domain.Contracts.Authentication; using ApplicationHub.Domain.Contracts.Authentication.Models; using AutoMapper; using Microsoft.EntityFrameworkCore; namespace ApplicationHub.Data.EF.Authentication.Repositories; public class UserRepository(AuthenticationDataContext authenticationDataContext, IMapper mapper) : IUserRepository { public User? GetUserByUserName(string userName) { return mapper.Map>( authenticationDataContext.Users .Include(x => x.Groups) .Where(x => x.UserName == userName && x.Active) .ToList() ) .FirstOrDefault(); } }