using Demo.Data.LocalData; using Demo.Data.Repository; using Demo.Domain.Models; namespace Demo.Domain.UseCase { public class GroupUseCase { private readonly GroupRepositoryImpl _repositoryGroupImpl; private List _groups = LocalStaticData.groups; public GroupUseCase(GroupRepositoryImpl repositoryGroupImpl) { _repositoryGroupImpl = repositoryGroupImpl; } public List GetAllGroups() { return _repositoryGroupImpl.GetAllGroups(); } public void GetGroupById(int id) { _repositoryGroupImpl.GetGroupById(id); } public void AddGroup(GroupLocalEntity group) { group.Id = _groups.Any() ? _groups.Max(g => g.Id) + 1 : 1; _repositoryGroupImpl.AddGroup(group); } public void UpdateGroup(int id) { _repositoryGroupImpl.UpdateGroup(id); } } }