I am passing an array of integers to ASP.NET Web API but I am receiving below error.
"An item with the same key has already been added."
This is my API endpoint:
[HttpGet]
[Route("api/Pen/ByPropertyIdList")]
public IQueryable<Pen> ListByPropertyIdList([FromUri] Int32[] propIds)
{
Boolean? deleted = false;
IQueryable < Pen > p = logic.ListByPropertyIdList(propIds, deleted).AsQueryable(); // I recieved the list of object perfectly
return p; // returning them generates the error
}
This is the URL I use;
api/pen/ByPropertyIdList?propIds=12&propIds=348
The endpoint accepts my array of integers but at return point, it generates the error. I believe it is due to the propIds
.