Concepts > Apps

An app is a contained amount of functionality. For example and App could be a Blog or ECommerce system. In a standard MrCMS.Web project, these are kept in /Apps from the root.

Within this folder there needs to be an [AppName]App.cs file and class in the root (e.g. CoreApp.cs in /Apps/Core). From there, the folder structure leans on existing ASP.NET MVC conventions from Controllers and Views folders.

MrCMSApp is the abstract base class that App classes need to descend from in order to wire up correctly. it contains abstract methods for void RegisterServices(IKernel kernel) , to allow explicit wiring of app services and whatnot if required (they're still autowired as standard, but you can do custom stuff here, like change lifecycles, or tell an object to map to a builder method).

There is also void RegisterApp(MrCMSAppRegistrationContext context) which is there to allow custom routing for your app. This is typically useful for data-driven UI apps, as anything but a post back to a page's URL is not routed out of the box (so as to allow the MrCMS catch-all route to function, rather than the {controller}/{action}/{id} one that comes as standard with ASP.NET MVC.

Last edited Nov 24, 2014 at 11:16 AM by gmstr, version 3


No comments yet.