One easy way, not a dictionary:
//DTO public class SearchDTO { public int MyProperty1 { get; set; } public int MyProperty2 { get; set; } public int MyProperty3 { get; set; } }
Where MyProperty1 , MyProperty2 , MyProperty3 are the parameters on the basis of which something needs to be searched.
//GET Method public string Get([FromUri]SearchDTO searchDTO) { return "search result"; }
The following is the url:
http: // localhost: 56880 / api / values? myproperty1 = 1 & myproperty2 = 2 & myproperty3 = 3
source share