Copied to clipboard

Flag this post as spam?

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


  • martin griffiths 780 posts 1177 karma points
    Jan 28, 2015 @ 18:09
    martin griffiths
    0

    UmbracoApiController SurfaceController in separate project

    I have a large project which contains a stack of shared code across many sites. I've now moved this code from each site into a shared MVC project.

    Whilst i've found it trivial to move all of my Views, CSS, scripts and models into this shared project, moving Controllers seems far from trivial.

    Does anyone know how to move UmbracoApiControllers and SurfaceControllers into a seperate "shared" project. Containing nothing more than the core Umbraco dlls? I'm thinking there's issues with routing and registering that requires extra code.

    Thanks in advance

    Martin

  • Richard Terris 273 posts 714 karma points
    Jan 30, 2015 @ 17:50
    Richard Terris
    0

    Hi Martin,

    All you need for an UmbracoApiController is a reference to Umbraco.Web so in theory that's all you need to do this and you'd just have a post build event to copy your project dll to the Umbraco project using it.

    But, I imagine you may be performing logic either in the controller, or in some helper class called by the controller? In which case you may need other references.

    As for routing then you probably don't need to set up any routes but I'm not sure what your controller does.

    Can you give more info on the controller (maybe post some code) and outline what the issues are, or what errors you are getting?

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft