I'd recommend creating a POCO to represent the options that this endpoint will be receiving:
public class CitySearchOptions
{
public List<string> Risk { get; set; }
public List<string> Rating { get; set; }
}
You can then use the [FromUri]
attribute in your controller signature to have the query string be automatically deserialized into your POCO. From there you can easily implement logic to act on the received values.
public async Task<IHttpActionResult> SearchCities([FromUri] CitySearchOptions options)
Note that the above is psuedo code and might not work for you out of the box without a few tweaks to the format of your query string. This question suggests that for list based query params you should prefer a format like this:
/cities?risk=a&risk=b&rating=x&rating=y