Initial version

This commit is contained in:
2026-06-09 22:27:38 +02:00
parent 5afbf3b01c
commit 5ff2ac8941
57 changed files with 2343 additions and 98 deletions
+34
View File
@@ -0,0 +1,34 @@
using EonaCat.gRPC.Core.Entities;
using EonaCat.gRPC.Core.Interfaces.Repositories;
using EonaCat.gRPC.Core.Interfaces.Services;
namespace EonaCat.gRPC.Service;
public class UserService : IUserService
{
private readonly IUserRepository _userRepository;
public UserService(IUserRepository userRepository)
{
_userRepository = userRepository;
}
public async Task<long> CreateUser(UserEntity user)
{
await _userRepository.AddAsync(user);
await _userRepository.SaveChangesAsync();
return user.Id;
}
public async Task<IEnumerable<UserEntity>> GetAsync()
{
var users = await _userRepository.ListAsync();
return users;
}
public async Task<UserEntity> GetAsync(long id)
{
var user = await _userRepository.GetAsync(id);
return user;
}
}