So I am making a very simple web api in .Net with some data I found. One of the columns in this data is called Crop_Type. This column holds things like 'Corn', 'Wheat', 'Cofee'... It is pretty easy to make a get request function that queries the database for only one crop.
i.e. what I did:
[HttpGet("Crop_Type/{crop_type}")]
public async Task<ActionResult<List<CCImpactAgricultureItem>>> GetByCrop_Type(string crop_type) {...}
now let's say a user wanted to get all records where Crop_Type = 'Corn', Crop_Type = 'Wheat', and Crop_Type = 'Rice'. I guess the user could just make several API calls and join the returned data. However, I was wondering if there is a way to make another get function that can query for this case without having to make a function that explicitly states that it takes in 3 different variables. Like is there a more general way to make a get function that can take any number of different crop types?
Crop_Type=CornorCrop_Type=Corn,Wheat,Riceint[] idto parseid=1&id=2&id=3