I have a function like this in my ProductsController:
public IHttpActionResult GetProduct(string id) { var product = products.FirstOrDefault((p) => p.Id == id); return Ok(product); } When I send a GET request with this URL:
api/products?id= it treats id as null. How can I make it to treat it as an empty string?
string id = ""then you can callGET api/products/