29 lines
682 B
C#
29 lines
682 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|