using GozareshgirProgramManager.Domain.UserAgg.Entities; using GozareshgirProgramManager.Domain.UserAgg.Repositories; using GozareshgirProgramManager.Infrastructure.Persistence._Common; using GozareshgirProgramManager.Infrastructure.Persistence.Context; using Microsoft.EntityFrameworkCore; namespace GozareshgirProgramManager.Infrastructure.Persistence.Repositories; public class UserRepository : RepositoryBase, IUserRepository { private readonly ProgramManagerDbContext _context; public UserRepository(ProgramManagerDbContext context) : base(context) { _context = context; } public Task GetByIdAsync(long id) { throw new NotImplementedException(); } public async Task GetByGozareshgirAccountId(long accountId) { return await _context.Users.FirstOrDefaultAsync(x => x.AccountId == accountId); } public Task GetByEmailAsync(string email) { throw new NotImplementedException(); } public Task GetByMobileAsync(string mobile) { throw new NotImplementedException(); } public Task> GetAllAsync() { throw new NotImplementedException(); } public Task> GetActiveUsersAsync() { throw new NotImplementedException(); } public Task AddAsync(User user) { throw new NotImplementedException(); } public void Update(User user) { throw new NotImplementedException(); } public void Delete(User user) { throw new NotImplementedException(); } public Task ExistsAsync(long id) { throw new NotImplementedException(); } public Task UsernameExistsAsync(string username) { throw new NotImplementedException(); } public Task EmailExistsAsync(string email) { throw new NotImplementedException(); } public Task MobileExistsAsync(string mobile) { throw new NotImplementedException(); } public async Task GetUserWithRolesByIdAsync(long userId, CancellationToken cancellationToken) { return await _context.Users.Include(x => x.RoleUser) .FirstOrDefaultAsync(x=>x.Id == userId, cancellationToken); } }