I've read all similar questions here, but i can't come up with solution. I'm trying to call web-api method:
[HttpGet]
public SearchViewModel Get(SearchTypes type, string text, [FromUri]Dictionary<string, string> toyParams)
{
//Code here
}
and i want to get last parameter from uri. I've tried
http://localhost:39101/#!/search/toys/fox?someParameter=123
and
http://localhost:39101/#!/search/toys/fox?toyParams[0].Key=someParameter&toyParams[0].Value=123
but toyParams Dictionary
always empty.
Just found out it is implicitly answered at another question here.
The solution it points at redirects to Model Binding in ASP.NET Core.
Or, short answer, you just compose your request like so:
http://localhost:39101/#!/search/toys/fox?toyParams[someParameter1]=123&toyParams[someParameter2]=456
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With