astral-api/Astral.Core/RepositoryInterfaces/IUserRepository.cs
2024-12-11 20:36:30 +00:00

33 lines
1 KiB
C#

// <copyright file="IUserRepository.cs" company="alveus.dev">
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
// </copyright>
using Astral.Core.Entities;
namespace Astral.Core.RepositoryInterfaces;
/// <summary>
/// <see cref="User" /> repository.
/// </summary>
public interface IUserRepository : IGenericRepository<User, Guid>
{
/// <summary>
/// Return a count of all users.
/// </summary>
/// <returns>A count of users in the table.</returns>
Task<long> CountUsersAsync();
/// <summary>
/// Find a user by their username.
/// </summary>
/// <param name="username">The username to search for.</param>
/// <returns>The user entity if found, or null.</returns>
Task<User> FindByUsername(string username);
/// <summary>
/// Find a user by their email address.
/// </summary>
/// <param name="emailAddress">The email address to search for.</param>
/// <returns>The user entity if found, or null.</returns>
Task<User> FindByEmailAddress(string emailAddress);
}