I have an object that contains a collection of items, each item being another object. In ASP.NET MVC, I'm a little unclear about how to go about using databinding in my "Create" Views for this collection, since each object in it has to be created new.
Any suggestions? Here is the schema.
Units
- UnitId
Rings
- RingId
Keys
- RingId (FK)
- KeyId (PK)
- KeyLiteral (FK)
- KeyValue
Literals
- LiteralId
- LiteralValue
and in the view...
<%= Html.DropDownList("Rank", new SelectList(... wut...) ) %>
It doesn't have to be a dropdown of course. I'm just lost because you see, at create time, the items don't exist. They are added by adding Keys to the "KeyRing" (Unit.Ring.Keys.Add). A Key expects a Literal and a Value to be added.