Förberett för övergång till entity framework

This commit is contained in:
2025-09-01 11:14:38 +02:00
parent eb9ea77dd9
commit b04fc7e06e
13 changed files with 191 additions and 73 deletions

View File

@ -17,6 +17,11 @@ public class ParticipantViewModel : ViewModelBase
{
Repository = repo;
}
//public ParticipantViewModel(IRepository<Participant> repo) : base()
//{
// Repository = repo;
//}
#endregion
#region Private Variables
@ -50,14 +55,16 @@ public class ParticipantViewModel : ViewModelBase
#endregion
#region Get Method
public ObservableCollection<Participant> Get()
public async Task<ObservableCollection<Participant>> GetAsync()
{
if (Repository != null)
{
ParticipantList = new ObservableCollection<Participant>(Repository.Get());
ParticipantList = await Repository.Get();
return ParticipantList;
}
return new();
_ParticipantList = new ObservableCollection<Participant>();
return ParticipantList;
}
#endregion
@ -86,7 +93,7 @@ public class ParticipantViewModel : ViewModelBase
if (tmp)
{
ParticipantObject = new Participant();
this.Get();
this.GetAsync();
}
return tmp;
}