This commit is contained in:
Dasha 2024-10-23 10:11:56 +03:00
commit 4105b80297

View File

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
@ -38,14 +37,21 @@ namespace Posechaemost.Data.Repository
return groupLocal;
}
public bool RemoveGroupById(int groupID)
{
public bool RemoveGroupById(int groupID){
GroupLocalEntity? groupLocal = GetAllGroups()
.Where(x => x.Id == groupID).FirstOrDefault();
if (groupLocal == null) return false;
return GetAllGroups().Remove(groupLocal);
}
// public GroupLocalEntity? AddGroup(String name, String id) //не работает
// {
// GroupLocalEntity? groupLocal = GetAllGroups()
// .Where(x => x.Id == groupID).FirstOrDefault();
// if (groupLocal == null) return false;
// return GetAllGroups().Remove(groupLocal);
// }
public bool UpdateGroupById(int groupID, String name)
{