Fix db seeding, migration, repository services
This commit is contained in:
parent
872dc1e263
commit
6b87902ca7
22 changed files with 606 additions and 64 deletions
|
@ -5,10 +5,10 @@ using CSR.Domain.Entities;
|
|||
public interface IUserRepository
|
||||
{
|
||||
Task<User?> GetByIdAsync(int id);
|
||||
Task<User?> GetByUsernameAsync(string username);
|
||||
// Task<User?> GetByEmailAsync(string email);
|
||||
// Task<User?> GetByUsernameAsync(string username);
|
||||
// Task<IEnumerable<User>> GetAllAsync();
|
||||
Task AddAsync(User user);
|
||||
Task<IEnumerable<User>?> GetAllByRoleIdAsync(int roleId);
|
||||
Task<User?> AddAsync(User user);
|
||||
Task UpdateAsync(User user);
|
||||
Task DeleteAsync(int id);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,12 @@ namespace CSR.Application.Interfaces;
|
|||
|
||||
public interface IUserService
|
||||
{
|
||||
public record CreateUserResult(Domain.Entities.User? User, string? ErrorMessage);
|
||||
record RegisterNewUserResult(Domain.Entities.User? User, IEnumerable<string>? Errors);
|
||||
|
||||
public void CreateUser(string username, string email, string password, bool isAdmin = false);
|
||||
Task<RegisterNewUserResult> RegisterNewUser
|
||||
(
|
||||
string username,
|
||||
string email,
|
||||
string password
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue