Example #1
0
        // returns the page view in render mode
        public ActionResult Render(string slug)
        {
            PageModel model = null;

            using (TransactionScope ts = new TransactionScope())
            {
                model = GetPageModel(slug);
                var widgets = _pageWidgetRepository.FilterBy(w => w.Page.Id == model.Id).ToList();
                model.Widgets = Mapper.Map <List <PageWidgetModel> >(widgets).OrderBy(r => r.Row).ThenBy(c => c.Col).ToList();
                model.Mode    = PageMode.Render;

                ts.Complete();
            }

            return(View("Page", model));
        }