Darbio
Darbio

Reputation: 11418

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.

Upvotes: 5

Views: 2669

Answers (2)

AlexCuse
AlexCuse

Reputation: 18296

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 :)

Upvotes: 3

Sly
Sly

Reputation: 15217

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.

Upvotes: 1

Related Questions