asp.net mvc - bootstrapping object via model binder
- by csetzkorn
Hi,
I have a domain object Thing which can contain several Categories. So I have implemented my HTML helper to create a checkbox group of all possible Categories. I have no problem receiving:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(Thing Thing, List<string> Categories)
However I am wondering whether I could use a custom Model binder to use just this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(Thing Thing)
So basically I am looking for a way to use the model binder to bootstrap the object tree/graph.
Any pointers appreciated. Thanks.
Christian