Copied to clipboard

Flag this post as spam?

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


  • Ilias 11 posts 81 karma points
    Feb 19, 2018 @ 12:40
    Ilias
    0

    I am studying a project developed by some guys in Visual Studio which cooperates with Umbraco. At first, I thought that this is a .NET MVC application on top of which Umbraco sits. However, after a more thorough look I can say it has nothing to do with a .NET MVC application. There are no controllers, there is neither program.cs nor startup.cs in the solution. Instead, there are umbraco files inside umbraco and umbraco_client folders.

    Of course, everything works fine. But how? When for example we write: localhost:50174/go/apply it can find the correct Umbraco content node. Who is responsible for the routing since there is no MVC routing?

  • Joshua Lemli 52 posts 234 karma points
    Feb 19, 2018 @ 19:18
    Joshua Lemli
    0

    When a project is compiled, the files that contain classes (controllers, application class where the routing takes place, models, etc) are "built" into .DLL (dynamic link library) files and placed inside the "bin" (binary) directory. If you are looking at the pre-built solution, the "source code" for the libraries/packages you are using will be absent!

    So all the umbraco controllers, models, etc, are simply not there as human-readable code (.cs files)! They are there, though. They're just compiled (and therefor not human-readable).

    The "Umbraco" and "Umbraco_Client" directories contain dependencies for runtime (like html and js) and config files.

    Routing is handled by Umbraco. You can create a class that inherits from the Umbraco application class to create your own cool custom stuff (like custom routing).

    I can say it has nothing to do with a .NET MVC application...

    Yes and no. It IS an MVC application. Did they use "vanilla" MVC to build it, or did they just work within Umbraco's GUI? If you continue to explore Umbraco, MVC, and Visual Studio, you can figure this out on your own!

    Who is responsible for the routing since there is no MVC routing?

    Umbraco is handling the routing. It is MVC routing. You just can't see the source .cs files.

    Check out what Umbraco looks like before it get's built and distributed as a package: https://github.com/umbraco/Umbraco-CMS/tree/dev-v7.8/src

Please Sign in or register to post replies

Write your reply to:

Draft