2025-08-09 15:03:12 +02:00

24 lines
782 B
C#

using System.Linq.Expressions;
using ApplicationHub.Domain.Contracts;
using ApplicationHub.Domain.Contracts.Authentication.Models;
using AutoMapper;
namespace ApplicationHub.Data.InMemory.Authentication;
public class UserDataContext(IMapper mapper) : IRepository<User>
{
public User? GetUserByUserName(string userName)
{
var result = UserData.Source
.Where(x => x.UserName == userName && x.Active)
.ToList();
return mapper.Map<List<User>>(result).FirstOrDefault();
}
public IEnumerable<User> Find(Expression<Func<User, bool>>? where = null, int? limit = null, int? offset = null, List<KeyValuePair<Expression<Func<User, bool>>, OrderDirection>>? order = null)
{
throw new NotImplementedException();
}
}