26 lines
691 B
C#
26 lines
691 B
C#
using OAService.Service.Servizi.Implementazioni;
|
|
using TecniStamp.Domain;
|
|
using TecniStamp.Service.Interfaces;
|
|
using TecniStamp.Service.Repository;
|
|
|
|
namespace TecniStamp.Service;
|
|
|
|
public class UserService : TService<Utente>, IUserService
|
|
{
|
|
private readonly ITecniStampUnitOfWork _unitOfWork;
|
|
|
|
public UserService(ITecniStampUnitOfWork unitOfWork) : base(unitOfWork)
|
|
{
|
|
_unitOfWork = unitOfWork;
|
|
}
|
|
|
|
public async Task<Utente> Salva(Utente entity)
|
|
{
|
|
if (entity.Id == Guid.Empty) await _unitOfWork.UserRepository.Put(entity);
|
|
else _unitOfWork.UserRepository.Update(entity);
|
|
|
|
await _unitOfWork.Salva();
|
|
|
|
return entity;
|
|
}
|
|
} |