Exemplo n.º 1
0
        public ActionResult Index(long themeId)
        {
            var theme = _dal.Get <Theme>(themeId);
            var model =
                new ThemeViewModel(
                    EnumHelpers.Enumerate <Opinion>()
                    .Select(
                        _ =>
                        new ThemeOpinionViewModel(_, theme.Comments.Where(c => c.Opinion == _).ToArray()))
                    .ToArray(),
                    theme);

            return(View(model));
        }