33 lines
996 B
C#
33 lines
996 B
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
using Posechaemost.Data.LocalData;
|
|
using Posechaemost.Data.LocalData.Entity;
|
|
|
|
namespace Posechaemost.Data.Repository
|
|
{
|
|
public class GroupRepositoryImpl
|
|
{
|
|
public List<GroupLocalEntity> GetAllGroups() => LocalStaticData.groups;
|
|
public GroupLocalEntity? UpdateGroup(String name)
|
|
{
|
|
GroupLocalEntity? groupLocal = GetAllGroups()
|
|
.Where(x => x.Name == name).FirstOrDefault();
|
|
if (groupLocal == null) return null;
|
|
groupLocal.Name = name;
|
|
return groupLocal;
|
|
}
|
|
|
|
public GroupLocalEntity? AddGroup(String name, String id)
|
|
{
|
|
GroupLocalEntity? groupLocal = GetAllGroups().FirstOrDefault();
|
|
groupLocal.Name = name;
|
|
groupLocal.Id = int.Parse(id);
|
|
return groupLocal;
|
|
}
|
|
}
|
|
} |