45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
// C:\Users\class_Student\source\repos\slarny4\Demo1\Domain\UseCase\GroupUseCase.cs
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Demo.Data.LocalData.Entity;
|
|
using Demo.Data.Repository;
|
|
|
|
namespace Demo.Domain.UseCase
|
|
{
|
|
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);
|
|
}
|
|
|
|
// Дополнительные методы, если нужны
|
|
}
|
|
} |