Demo/Domain/UseCase/GroupUseCase.cs

32 lines
971 B
C#
Raw Permalink Normal View History

using Posechaemost.Data.LocalData.Entity;
using Posechaemost.Data.Repository;
using Posechaemost.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Posechaemost.Domain.UseCase
{
public class GroupUseCase
{
private GroupRepositoryImpl _repositoryGroupImpl;
public GroupUseCase(GroupRepositoryImpl repositoryGroupImpl)
{
_repositoryGroupImpl = repositoryGroupImpl;
}
public List<Group> GetAllGroups() => _repositoryGroupImpl.GetAllGroups()
.Select(it => new Group { Id = it.Id, Name = it.Name}).ToList();
2024-10-23 07:06:56 +00:00
public bool UpdateGroupName(String id, String name1) {
return _repositoryGroupImpl.UpdateGroupById(int.Parse(id), name1);
}
2024-10-23 07:06:56 +00:00
public bool AddGroup(String name, String id)
2024-10-18 08:43:40 +00:00
{
return _repositoryGroupImpl.AddGroup(name, id);
}
}
}