Having the following action:
public IHttpActionResult GetStuff(
string like = null,
[FromUri]string[] state = null,
[FromUri]string[] mode = null,
[FromUri]string[] label = null,
)
when I query it as /api/stuff?state=A&state=B the model binder instantiates state array with 2 string values and it's kind enough to instantiate empty mode and label arrays so I don't need to check for nulls. However, if I query it as /api/stuff?&state=A&state=B (note extra ampersand) mode and label arrays are no longer empty - they contain a single null elements both. Why?
In my understanding the query strings are equivalent. Is there any way to fix it without writing custom binder?