using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using PARR.Core.Repositories.Interfaces; using PARR.DAL.Context; using PARR.DAL.Repositories.Base; using PARR.Domain.Entities; namespace PARR.DAL.Repositories { internal class UserRepository : BaseRepository, IUserRepository { public UserRepository(DataContext dataContext, ILogger logger) : base(logger, dataContext) { } public async Task GetByIpWithRolesAsync(string ipAddress) { return await EntitySet .Include(t => t.Roles).ThenInclude(t => t.Role) .FirstOrDefaultAsync(t => t.Ip == ipAddress); } } }