Show different sub-sets in edit view
- by Martin R-L
In the context of C# 4, ASP.NET MVC 2, and NHibernate; I've got the following scenario:
Let's assume an entity Product that have an association to ProductType.
In a product edit view; how do I implement that only a sub-set of the product's properties are shown in an elegant and DRY way?
Use a product view model builder, and from different view models automagically generate the view with my own Html.EditorForModel() (including drop-downs and other stuff not out-of-the-box)?
Attribute the properties of one view model and use the Html.EditorForModel() way aforementioned?
Use one model, but implement different web controls (view strategies) (can it be done DRY?)?
Something else entirely?