Given the following class, what is your opinion on the best way to handle create/edit where Attributes.Count can be any number.
public class Product {
pub
Look at Steve Sanderson’s blog post Editing a variable length list, ASP.NET MVC 2-style.
Your action method receives your native domain model Product and stays pretty simple:
public ActionResult Edit(Product model)
Edit.aspx
<% foreach (Attribute attr in Model.Attributes)
{
Html.RenderPartial("AttributeEditRow", attr);
} %>
AttributeEditRow.ascx
Pay your attention to helper extension Html.BeginCollectionItem(string)
<% using(Html.BeginCollectionItem("Attributes")) { %>
<% } %>
Adding and editing of new attributes is possible too. See the post.