Exemplo n.º 1
0
        public ViewResult List(UserSelection userSelection)
        {
            var model = new ContextModel(_dayRepository, _languageRepository)
            {
                Message = _messageRepository.Messages.Single(m => m.DayId == userSelection.SelectedDayId && m.LanguageId == userSelection.SelectedLanguageId),
                FlagPath = _languageRepository.Languages.Single(p => p.Id == userSelection.SelectedLanguageId).PartialFlagPath
            };

            return View(model);
        }
        public ViewResult List(UserSelection userSelection)
        {
            var model = new ContextModel()
            {
                Languages = _languageRepository.LanguagesEnumerable,
                Days = _dayRepository.DaysEnumerable,
                Messages = _messageRepository.MessagesEnumerable
                    .Where(
                        m => m.DayId == userSelection.SelectedDayId && m.LanguageId == userSelection.SelectedLanguageId),
                FlagPath = GetImagePath(userSelection.SelectedLanguageId)
            };

            return View(model);
        }