Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert 4 posts 24 karma points
    May 22, 2012 @ 22:37
    Robert
    0

    Basic question to get started?

    I think this is a very basic and simple question... (I come from a Sitecore oriented workplace so please forgive me my dumbness if there isn't something like the Sitecore.Context class...)

    How do I retrieve the Umbraco application- or website- context object from which I can retrieve Hives and other contextual data? (Or please tell me if I'm missing a point here...)

    Please note:I'm looking for a way to get this outside a controller.

    I know that it's possible to get a IRoutableRequestContext inside a controller (like the code below taken from this site), but can I get it in a custom class from some static variable or something?

    [Surface("b9c79cc7-cbdb-4df6-88ee-ce25c9a9c38d")]
    public class BooksSurfaceController : SurfaceController
    {
         public BooksSurfaceController(IRoutableRequestContext requestContext)
             : base(requestContext)
         {
    
         }
    
          private ReadonlyGroupUnitFactory GetHiveReader()
          {
               return RoutableRequestContext.Application.Hive.GetReader(new Uri("v5-BooksExample://"));
          }
    }

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies