mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Standardized property naming in user-related entities to use 'Id' suffix (e.g., UserAccountId). Moved and updated repository interfaces and implementations to the DataAccessLayer.Repositories namespace. Refactored DBSeed seeders to use repository classes and improved structure. Updated .gitignore and project references
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using DataAccessLayer;
|
|
using DataAccessLayer.Entities;
|
|
using DataAccessLayer.Repositories;
|
|
|
|
namespace BusinessLayer.Services
|
|
{
|
|
public class UserService : IUserService
|
|
{
|
|
private readonly IUserAccountRepository _userAccountRepository;
|
|
|
|
public UserService(IUserAccountRepository userAccountRepository)
|
|
{
|
|
_userAccountRepository = userAccountRepository;
|
|
}
|
|
|
|
public IEnumerable<UserAccount> GetAll(int? limit, int? offset)
|
|
{
|
|
return _userAccountRepository.GetAll(limit, offset);
|
|
}
|
|
|
|
public UserAccount? GetById(Guid id)
|
|
{
|
|
return _userAccountRepository.GetById(id);
|
|
}
|
|
|
|
public UserAccount? GetByUsername(string username)
|
|
{
|
|
return _userAccountRepository.GetByUsername(username);
|
|
}
|
|
|
|
public UserAccount? GetByEmail(string email)
|
|
{
|
|
return _userAccountRepository.GetByEmail(email);
|
|
}
|
|
|
|
public void Add(UserAccount userAccount)
|
|
{
|
|
_userAccountRepository.Add(userAccount);
|
|
}
|
|
|
|
public void Update(UserAccount userAccount)
|
|
{
|
|
_userAccountRepository.Update(userAccount);
|
|
}
|
|
|
|
public void Delete(Guid id)
|
|
{
|
|
_userAccountRepository.Delete(id);
|
|
}
|
|
}
|
|
}
|