Files
mws.backend.dotnet/application/Common/Repositories/IUserRepository.cs
T
2026-09-13 18:02:09 +07:00

18 lines
975 B
C#

using mws.backend.dotnet.application.Common;
using mws.backend.dotnet.application.Users;
using mws.backend.dotnet.domain.Users;
namespace mws.backend.dotnet.application.Common.Repositories;
public interface IUserRepository : IRepository<User>
{
Task<User?> GetByIdAsync(Guid id, CancellationToken ct = default);
Task<User?> GetByIdWithRoleAsync(Guid id, CancellationToken ct = default);
Task<User?> GetByUsernameWithRoleAsync(string username, CancellationToken ct = default);
Task<bool> ExistsByUsernameAsync(string username, CancellationToken ct = default);
Task<bool> ExistsByRoleIdAsync(Guid roleId, CancellationToken ct = default);
Task<List<Guid>> GetRoleIdsAsync(Guid userId, CancellationToken ct = default);
Task<List<User>> SearchWithRoleAsync(string? term, int? take, CancellationToken ct = default);
Task<PagedResult<User>> SearchWithRolePagedAsync(UserListFilter filter, int page, int pageSize, CancellationToken ct = default);
}