What are the requirements of a collection type when model binding?

Posted by Richard Ev on Stack Overflow See other posts from Stack Overflow or by Richard Ev
Published on 2010-05-12T15:25:12Z Indexed on 2010/05/12 15:44 UTC
Read the original article Hit count: 152

I have been reviewing model binding with collections, specifically going through this article

http://weblogs.asp.net/nmarun/archive/2010/03/13/asp-net-mvc-2-model-binding-for-a-collection.aspx

However, the model I would like to use in my code does not implement collections using generic lists. Instead it uses its own collection classes, which inherit from a custom generic collection base class, the declaration of which is

public abstract class CollectionBase<T> : IEnumerable<T>

The collections in my POSTed action method are all non-null, but contain no elements.

Can anyone advise?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about binding