Studety/Demo/Data/Repository/GroupRepositoryImpl.cs

29 lines
682 B
C#
Raw Normal View History

2024-10-18 06:12:15 +00:00
using Demo.Data.LocalData;
using Demo.domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo.Data.Repository
{
public class GroupRepositoryImpl
{
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;
}
}
}