Developing Project outside Orchard

Topics: Administration, General
Dec 9, 2013 at 10:12 AM
Is this possible to develop a separate project just like we normal develop app. as ASP.NET MVC and then make it orchard module?

I really want to keep my ASP.NET MVC concept and wants to continue developing in that pattern. i need to develop some pages which will perform some CRUD operations and then wants to add them in Orchard administration section.
Dec 9, 2013 at 10:39 AM
Since modules are almost MVC areas you can convert an MVC area into an Orchard module without much hassle. Once inside Orchard basically nothing apart from having a Module.txt is mandatory so you can continue to do everything just as in an MVC area, using pieces from Orchard (e.g. the ability to hook into the amdin menu) as you need.
Dec 9, 2013 at 10:55 AM
are you saying once i developed a separate MVC project i can simply make it orchard module by placing only Module.txt file in it?
and what about other stuff which Orchard uses like Driver? and putting all stuff in content type? if i follow the below link i see Orchard has programmed creating module in its own way.
Dec 9, 2013 at 10:56 AM
I would recommend to switch to Orchard module as soon as possible, it will save you some work to repeat: routing, navigation, styling.

You will need to mark your controllers with [Admin] attribute, so that pages are rendered in AdminTheme. You will probably need some content management or at least repositories, which are easy to declare and access using Models, content manager, dependency injection and database migration (construction of database files in Orchard DB and content types). If you are going to use these in your CRUD operations (i.e. use Orchard DB to store your data and connections/transaction provided by Orchard), better sooner than later. And I can't see a simple way to keep developing a seperate app and keep the integration to Orchard.

Marked as answer by mrhammad on 12/9/2013 at 10:41 PM
Dec 9, 2013 at 11:09 AM
It seems like Orchard is using code first approach to create database? is there way i already have some tables created in database and then use it. Please post some sample code regarding showing a link inside admin for my plugin.
Dec 9, 2013 at 11:50 AM
Yes, Orchard modules uses migration classes to create DB tables, indexes etc.

Yes, I guess, you can create tables in Orchard DB yourself (with orchard naming convention) and nhibernate picks up the mapping. Then you can use a repository or HQL to access them. See LocalizationService.cs in to see an example to get the nhibernate session and execute a query. There is some discussion related to this here:

If you mean navigation links in the admin menu on the left hand side, here is an example and explanation:

Marked as answer by mrhammad on 12/9/2013 at 10:41 PM