public override ActionResult Index(Umbraco.Web.Models.RenderModel model)
 {
     var image = _imageRepository.GetCurrentAndNextImage();
     var homePageModel = new ImagePageModel();
     homePageModel.CurrentImage = image.Item1;
     homePageModel.NextImage = image.Item2;
     ViewBag.ImageWidth = homePageModel.CurrentImage.Width;
     return View(@"~\Views\Home.cshtml", homePageModel);
 }
 public ActionResult Id(string id)
 {
     var parts = id.Split(new[] {"-"}, StringSplitOptions.None);
     var parsedId = parts.Last();
     var images = _imageRepository.GetCurrentAndNextImage(int.Parse(parsedId));
     var homePageModel = new ImagePageModel();
     homePageModel.CurrentImage = images.Item1;
     homePageModel.NextImage = images.Item2;
     ViewBag.ImageWidth = homePageModel.CurrentImage.Width;
     return PartialView(@"~\Views\Home.cshtml", homePageModel);
 }
Exemplo n.º 3
0
        private static void BootstrapContainer()
        {
            //windsor

            var container = new WindsorContainer();
            #pragma warning disable 618
            container.Kernel.ReleasePolicy = new NoTrackingReleasePolicy();
            #pragma warning restore 618
            var assembly = new ImagePageModel().GetType().Assembly;
            var umbracoAssembly = new RenderControllerFactory().GetType().Assembly;
            container.Install(new ApplicationInstaller(assembly));
            container.Install(new UmbracoInstaller(umbracoAssembly));
            var controllerFactory = new WindsorControllerFactory(container.Kernel);
            ControllerBuilder.Current.SetControllerFactory(controllerFactory);
            ServiceStackConfiguration.Initialize(container, assembly);
            CastleObjectFactory.SetContainer(container);
        }