Förberett för övergång till entity framework
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user