41 lines
956 B
C#
41 lines
956 B
C#
using System.Collections.Generic;
|
|
using AttendanceApp.Data.Repository;
|
|
using AttendanceApp.Domain.Models;
|
|
|
|
namespace AttendanceApp.Domain.UseCases
|
|
{
|
|
public class GroupUseCase
|
|
{
|
|
private readonly IGroupRepository _groupRepository;
|
|
|
|
public GroupUseCase(IGroupRepository groupRepository)
|
|
{
|
|
_groupRepository = groupRepository;
|
|
}
|
|
|
|
public IEnumerable<Group> GetAllGroups()
|
|
{
|
|
return _groupRepository.GetAllGroups();
|
|
}
|
|
|
|
public Group GetGroupById(int id)
|
|
{
|
|
return _groupRepository.GetGroupById(id);
|
|
}
|
|
|
|
public void AddGroup(Group group)
|
|
{
|
|
_groupRepository.AddGroup(group);
|
|
}
|
|
|
|
public void UpdateGroup(Group group)
|
|
{
|
|
_groupRepository.UpdateGroup(group);
|
|
}
|
|
|
|
public void DeleteGroup(int id)
|
|
{
|
|
_groupRepository.DeleteGroup(id);
|
|
}
|
|
}
|
|
} |