Raspisanie/Zurnal/Date/Repository/GroupRepositoryImpl.cs

63 lines
1.6 KiB
C#
Raw Permalink Normal View History

2024-10-21 11:56:16 +00:00
using Demo.domain.Models;
using System.Diagnostics;
using Zurnal.Date.LocalDate;
using Zurnal.Date.Repository;
namespace Demo.Data.Repository
{
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
public class GroupRepositoryImpl : IGroupRepository
{
public List<GroupLocalEntity> GetAllGroups() => LocalStaticData.groups;
public void AddGroup(GroupLocalEntity newGroup)
{
LocalStaticData.groups.Add(newGroup);
}
public void UpdateGroupName(int groupId, string newName)
{
var group = LocalStaticData.groups.FirstOrDefault(g => g.Id == groupId);
if (group != null)
{
group.Name = newName;
}
}
public GroupLocalEntity GetGroupById(int groupId)
{
return LocalStaticData.groups.FirstOrDefault(g => g.Id == groupId);
}
private static string GetDebuggerDisplay()
{
return $"GroupRepository with {LocalStaticData.groups.Count} groups";
}
internal void AddGroup(Group group)
{
throw new NotImplementedException();
}
public List<GroupLocalEntity> GetAllGroup()
{
throw new NotImplementedException();
}
public bool RemoveGroupById(int groupID)
{
throw new NotImplementedException();
}
public bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup)
{
throw new NotImplementedException();
}
bool IGroupRepository.AddGroup(GroupLocalEntity newGroup)
{
throw new NotImplementedException();
}
}
}