42 lines
941 B
C#
42 lines
941 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using AttendanceApp.Data.Repository;
|
|
using AttendanceApp.Domain.Models;
|
|
|
|
namespace AttendanceApp.Domain.UseCases
|
|
{
|
|
public class UserUseCase
|
|
{
|
|
private readonly IUserRepository _userRepository;
|
|
|
|
public UserUseCase(IUserRepository userRepository)
|
|
{
|
|
_userRepository = userRepository;
|
|
}
|
|
|
|
public IEnumerable<User> GetAllUsers()
|
|
{
|
|
return _userRepository.GetAllUsers();
|
|
}
|
|
|
|
public User GetUserById(Guid id)
|
|
{
|
|
return _userRepository.GetUserById(id);
|
|
}
|
|
|
|
public void AddUser(User user)
|
|
{
|
|
_userRepository.AddUser(user);
|
|
}
|
|
|
|
public void UpdateUser(User user)
|
|
{
|
|
_userRepository.UpdateUser(user);
|
|
}
|
|
|
|
public void DeleteUser(Guid id)
|
|
{
|
|
_userRepository.DeleteUser(id);
|
|
}
|
|
}
|
|
} |