Question: I have a HttpGet endpoint that takes in an `id`. I have figured out how to get the controller and action names but I am also wanting to get the parameters used in the endpoint because I want to be able to distinguish them from a normal default GET.

Here is the endpoint and example of what I am wanting:

```
// GET: api/PatientSearch/5
[HttpGet("{id}", Name = "Get")]
public string Get(int id)
{
    _customLogger.LogInfoEvent(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString());

    return "value";
}

```

This currently works and logs the action as 'Get' But id' like it to log as `'Get {id}'`

Answer: 
```
// GET: api/PatientSearch/5
    [HttpGet("{id}", Name = "Get")]
    public string Get(int id)
    {
        var parameters = MethodBase.GetCurrentMethod().GetParameters();
        var paramNames = String.Join(", ", parameters.Select(p => p.Name)); // myString, myInt

        return this.ControllerContext.RouteData.Values["action"] + "{"+ paramNames + "}";
    }

```

Screenshots of test result:  

**public string Get(int id)**

[![enter image description here](https://i.stack.imgur.com/crShN.png)](https://i.stack.imgur.com/crShN.png)

**public string Get(int id, string str)**

[![enter image description here](https://i.stack.imgur.com/a7G4U.png)](https://i.stack.imgur.com/a7G4U.png)
```
var q = ControllerContext.RouteData.Values["id"];

```

or

```
var q = id;

```