3
Vote

Adding support for collection of simple types on the default action selector.

description

Currently if we have the following action, the request below would fail with "Multiple actions were found..." error because the parameters are not simple types so they're not used for disambiguation by the default action selector. For vnext, we can consider adding special support for collection of simple types.

public string Get([FromUri] IEnumerable<long> id)
public string Get([FromUri] IEnumerable<long> campaignId)

Request: GET /api/Test?id=1&id=2&id=3

comments

tugberk wrote Sep 29, 2012 at 8:35 AM

Before the action selector, this code is not even gonna compile. I am guessing that you probably meant something like this:

public string GetById([FromUri] IEnumerable<long> id)
public string GetByCampaignId([FromUri] IEnumerable<long> campaignId)