Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC3 ModelBinder for DynamicObject
    primarykey
    data
    text
    <p>I'm looking to see if there is a sample project, tutorial, contrib branch or anything like that that details implementing a custom ModelBinder for MVC3 to support objects inheriting from DynamicObject.</p> <p>I have an domain object that has a dynamic number of properties as defined by the database, and these can change at run time. To make using the object easier I've made my class implementation inherit from DynamicObject and am passing the model to the view via the [dynamic] keyword. </p> <p>All of the dynamic properties for the object are in a collection property on the object called "Attributes". I'd like to create a series of editor templates to flesh out the model, ideally so all I have to do is make a call along the lines of Html.EditorForModel() and it will dynamically build the UI. </p> <p>The problem is I'm not having much luck finding an implementation of a ModelBinder capable of inspecting a DynamicObject and scaffolding out the UI (I think that's the right term for this?). </p> <p>I found the IDictionary ModelBinder project done in one of the MVCConf videos done by Roberto Hernandez (@hernandezrobert) on <a href="http://channel9.msdn.com/Series/mvcConf/mvcConf-2-Roberto-Hernandez-MVC-3-Extensibility" rel="nofollow">MVC3 Extensability</a> (source at <a href="http://mvcextensibility.codeplex.com/" rel="nofollow">http://mvcextensibility.codeplex.com/</a>) but I haven't had much luck adapting it to my purposes. I was wondering if anyone else has tried to create a model binder capable of doing what I'm describing? or could maybe point me in the right direction?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload