slarny4/Demo1/Domain/UseCase/GroupUseCase.cs

36 lines
851 B
C#
Raw Normal View History

2024-11-25 04:33:26 +00:00
using Demo.Data.Repository;
using Demo.Data.RemoteData.RemoteDataBase.DAO;
2024-10-28 12:42:04 +00:00
using System.Collections.Generic;
2024-10-21 22:57:01 +00:00
2024-10-28 12:42:04 +00:00
namespace Demo.Domain.UseCase
2024-10-21 22:57:01 +00:00
{
public class GroupUseCase
{
2024-10-24 08:50:32 +00:00
private readonly IGroupRepository _groupRepository;
2024-10-21 22:57:01 +00:00
2024-10-24 08:50:32 +00:00
public GroupUseCase(IGroupRepository groupRepository)
2024-10-21 22:57:01 +00:00
{
_groupRepository = groupRepository;
}
2024-10-24 08:50:32 +00:00
public IEnumerable<Group> GetAllGroups()
2024-10-23 09:52:43 +00:00
{
2024-10-24 08:50:32 +00:00
return _groupRepository.GetAllGroups();
2024-10-23 09:52:43 +00:00
}
2024-10-24 08:50:32 +00:00
public void AddGroup(Group group)
2024-10-23 09:52:43 +00:00
{
2024-10-24 08:50:32 +00:00
_groupRepository.AddGroup(group);
2024-10-23 09:52:43 +00:00
}
2024-11-25 04:33:26 +00:00
public void UpdateGroupName(int id, string name)
2024-10-23 09:52:43 +00:00
{
2024-11-25 04:33:26 +00:00
_groupRepository.UpdateGroupName(id, name);
2024-10-23 09:52:43 +00:00
}
2024-10-24 08:50:32 +00:00
public void DeleteGroup(int id)
2024-10-23 09:52:43 +00:00
{
2024-10-24 08:50:32 +00:00
_groupRepository.DeleteGroup(id);
2024-10-23 09:52:43 +00:00
}
2024-10-21 22:57:01 +00:00
}
2024-10-24 08:50:32 +00:00
}