I wrote a function in angularjs, that send the array to API. (I'm using asp.net).
function getDimensionTagsByIds(tagIds) {
return msApi.resolve('app.entities.dimensions-tags-search@query', {tagsId: tagIds});
}
this is the function in the API that receives this request:
[HttpGet]
[Route("tags-search")]
[EnableQuery]
public async Task<IQueryable<SimpleDimensionViewModel>> SearchTags([FromUri] List<int> tagIds)
{
return (await _mediator.SendAsync(new ProjectedQuery<DimensionTag, SimpleDimensionViewModel>())).Where(dt => tagIds.Contains((int)dt.TagId));
}
when I debug my code I see that the tagIds get all the time empty List. I tried to change the parameter to array, but its still doesn't work. what I'm doing wrong?
thanks for the help!