Exemple #1
0
 public ManageParticipantsViewModel()
 {
     using (AppContext context = new AppContext()) {
         context.Participants.Load();
         ConvertCollection convert = new ConvertCollection();
         Participants = convert.GetParticipantModelFrom(context.Participants.Local);
     }
 }
Exemple #2
0
        public ManageRafflesViewModel(IUnitOfWork uow)
        {
            this.uow = uow;

            var raffles = uow.Raffles.GetAll()
                          .Include(r => r.RaffleItems)
                          .Include(r => r.RaffleParticipants)
                          .Include(r => r.Winners)
                          .ToObservableCollection();
            var items        = uow.Items.GetAll().ToObservableCollection();
            var participants = uow.Participants.GetAll()
                               .ToObservableCollection();

            var convert = new ConvertCollection();

            Raffles      = convert.GetRaffleModelFrom(raffles);
            Items        = convert.GetItemModelFrom(items);
            Participants = convert.GetParticipantModelFrom(participants);
        }