Refactor data layer, add business layer

This commit is contained in:
Aaron Po
2026-01-13 00:13:39 -05:00
parent c928ddecb5
commit 43dcf0844d
38 changed files with 576 additions and 586 deletions

View File

@@ -0,0 +1,50 @@
using DataAccessLayer;
using DataAccessLayer.Entities;
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);
}
}
}