3

This answer suggests that one should create a new project for Umbraco content management alongside the existing MVC application. I have created the new project as suggested, and installed Umbraco into it through NuGet.

So now I have 2 projects, one for my MVC application and one for CMS. Both are working as expected, meaning that I can add contents through the Umbraco UI after building the newly created Umbraco project.

My question is, how can I query the content from inside the MVC application in order to show the manageable content on my views? It seems that it can be done through the Umbraco REST API, but as both databases (for the MVC application and the CMS application) will reside on the same server this seems unefficient.

Community
  • 1
  • 1
Koja
  • 716
  • 2
  • 9
  • 25

1 Answers1

5

Traditionally one of the problems with Umbraco is that it is not a pure MVC architecture. This means that people are sometimes led to believe they will be able to implement a 100% MVC solution and then just manage their content through Umbraco.

The bad news is that you've found out the main issue with Umbraco so far. Namely that it doesn't render things using the standard MVC rendering engine. It has to use custom controllers to retrieve view-models, such as SurfaceControllers or UmbracoApiControllers (as mentioned by your example of using REST services to return the page data).

The good news is that things are getting better. Version 7.3.0 will be the first version to be bundled with MVC 5 as standard. Check out the beta version here to see if it is more suitable for your needs. Of course you may need to upgrade your MVC project to MVC 5 too.

Hopefully with 7.3.0 you'll be good.

itsMasoud
  • 1,335
  • 2
  • 9
  • 25
csharpforevermore
  • 1,472
  • 15
  • 27