Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 3 and NHibernate Scaffolding

I found this article [http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/], which explains how to use MVC Scaffolding with one-to-many relationships in EF to create a listbox with an enumerated collection as the choice.

I tried using this with my project, but I have run into a problem - I don't want to use EF (or include a reference to it). I am using POCOs which are then mapped using a repository pattern and persisted using NHibernate.

Is there a way to create the same scaffolding listboxes for POCOs without having to create the DataContext which the article created.

Edit: I do know how to do this manually, I am looking for a way for the scaffold code to do this for me.

like image 608
Darbio Avatar asked Oct 11 '22 07:10

Darbio


2 Answers

I think the post on Overriding T4 Templates from the same series should tell you all you need to know to switch to a repository template based on NHibernate. If you end up implementing your own, please post them somewhere :)

like image 138
AlexCuse Avatar answered Oct 14 '22 03:10

AlexCuse


I've seen a project, that tried to implement templates for NHibernate and MVC scaffolding, but according to this thread it seems to be closed.

like image 29
Sly Avatar answered Oct 14 '22 03:10

Sly