Copied to clipboard

Flag this post as spam?

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


  • Ryios 122 posts 263 karma points
    Jul 18, 2015 @ 20:30
    Ryios
    0

    Route Hijacking - Adding controller repositories

    When route hijacking a document type with a RenderMvcController,

    Is it possible for me to somehow inject my own repository into the controllers constructor.

    For example,

    public XYZ_DocController : RenderMvcController {
        public XYZ_DocController(IMyRepository things, IPublishedContent content) : base(content) {
    
        }
    
    }
    

    Is there a way to rejister my repository as a Dependency (like with Unity) so that when umbraco instantiates my RenderMvcController it passes in an instance of things and content?

    Or do I have to create a singleton repository pattern and call them myself without referrencing them in the constructor (old school way)?

  • Yakov Lebski 590 posts 2344 karma points
    Jul 19, 2015 @ 06:02
    Yakov Lebski
    100

    You can see here documentation here

  • Ryios 122 posts 263 karma points
    Jul 21, 2015 @ 18:19
    Ryios
    0

    Awesome, thanks

Please Sign in or register to post replies

Write your reply to:

Draft