Example #1
0
        public RaffleWinnersViewModel(IUnitOfWork uow)
        {
            this.uow = uow;

            var raffles = uow.Raffles.GetAll()
                          .Include(r => r.RaffleItems)
                          .Include(r => r.RaffleParticipants)
                          .Include(r => r.Winners)
                          .ToObservableCollection();
            var convert = new ConvertCollection();

            Raffles = convert.GetRaffleModelFrom(raffles);
        }
Example #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);
        }