Add project files.

This commit is contained in:
2025-10-11 08:15:33 +02:00
commit 5d1e7858f2
140 changed files with 7567 additions and 0 deletions

View File

@ -0,0 +1,37 @@
using Common.Library;
using GreadyPoang.EntityLayer;
using System.Collections.ObjectModel;
namespace GreadyPoang.ViewModelLayer;
public class MethodSharingService : ViewModelBase, IMethodSharingService<Participant>
{
private readonly IRepository<Participant> _repository;
public MethodSharingService(IRepository<Participant> repository)
{
_repository = repository;
}
public ObservableCollection<Participant> Get()
{
ObservableCollection<Participant> _participantList = new();
if (_repository != null)
{
var participantsTask = _repository.Get();
var participants = participantsTask is Task<IEnumerable<Participant>> task
? task.GetAwaiter().GetResult()
: (IEnumerable<Participant>)participantsTask;
foreach (var participant in participants)
{
if (!_participantList.Any(p => p.ParticipantId == participant.ParticipantId))
{
_participantList.Add(participant);
}
}
}
return _participantList;
}
}