29 lines
738 B
C#
29 lines
738 B
C#
using UserManagement.Domain.Entities;
|
|
|
|
namespace UserManagement.Infrastructure.Interfaces
|
|
{
|
|
public interface IUserRepository
|
|
{
|
|
// CREATE
|
|
Task<User?> AddAsync(User user);
|
|
|
|
// READ ALL
|
|
Task<IEnumerable<User>> GetAllAsync(bool includeRoles = true);
|
|
|
|
// READ BY ID
|
|
Task<User?> GetByIdAsync(int id, bool includeRoles = true);
|
|
|
|
// READ BY USERNAME
|
|
Task<User?> GetByUsernameAsync(string username, bool includeRoles = true);
|
|
|
|
// READ BY ROLE
|
|
Task<IEnumerable<User>> GetByRoleAsync(string role);
|
|
|
|
// UPDATE
|
|
Task<bool> UpdateAsync(User user);
|
|
|
|
// DELETE
|
|
Task<bool> DeleteAsync(User user);
|
|
}
|
|
}
|