85 lines
2.3 KiB
C#
85 lines
2.3 KiB
C#
using Zurnal.domain.Models;
|
|
using System.Diagnostics;
|
|
using Zurnal.Date.LocalDate;
|
|
using Zurnal.Date.Repository;
|
|
|
|
namespace Zurnal.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> AllGroup => 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();
|
|
}
|
|
|
|
public void AddGroupFromRegex(System.Text.RegularExpressions.Group group)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
System.Text.RegularExpressions.Group IGroupRepository.GetGroupById(int id)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
IEnumerable<System.Text.RegularExpressions.Group> IGroupRepository.GetAllGroups()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void UpdateGroup(System.Text.RegularExpressions.Group group)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void DeleteGroup(int id)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |