5

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.

Darbio
  • 11,286
  • 12
  • 60
  • 100

2 Answers2

3

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

AlexCuse
  • 18,008
  • 5
  • 42
  • 51
1

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.

Sly
  • 15,046
  • 12
  • 60
  • 89