# QueryTransformExtensions Methods

- Package: [Aspire.Hosting.Yarp](/reference/api/csharp/aspire.hosting.yarp.md)
- Type: [QueryTransformExtensions](/reference/api/csharp/aspire.hosting.yarp/querytransformextensions.md)
- Kind: `Methods`
- Members: `3`

Extensions for adding query transforms.

## WithTransformQueryRemoveKey(YarpRoute, string)

- Name: `WithTransformQueryRemoveKey(YarpRoute, string)`
- Modifiers: `extension`
- Returns: [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs#L40-L41)

Adds the transform that will remove the given query key.

```csharp
public static class QueryTransformExtensions
{
    public static YarpRoute WithTransformQueryRemoveKey(
        this YarpRoute route,
        string queryKey)
    {
        // ...
    }
}
```

## Parameters

- `route` ([YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md))
- `queryKey` (`string`)

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithTransformQueryRouteValue(YarpRoute, string, string, bool)

- Name: `WithTransformQueryRouteValue(YarpRoute, string, string, bool)`
- Modifiers: `extension`
- Returns: [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs#L30-L31)

Adds the transform that will append or set the query parameter from a route value.

```csharp
public static class QueryTransformExtensions
{
    public static YarpRoute WithTransformQueryRouteValue(
        this YarpRoute route,
        string queryKey,
        string routeValueKey,
        bool append = true)
    {
        // ...
    }
}
```

## Parameters

- `route` ([YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md))
- `queryKey` (`string`)
- `routeValueKey` (`string`)
- `append` (`bool`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithTransformQueryValue(YarpRoute, string, string, bool)

- Name: `WithTransformQueryValue(YarpRoute, string, string, bool)`
- Modifiers: `extension`
- Returns: [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs#L20-L21)

Adds the transform that will append or set the query parameter from the given value.

```csharp
public static class QueryTransformExtensions
{
    public static YarpRoute WithTransformQueryValue(
        this YarpRoute route,
        string queryKey,
        string value,
        bool append = true)
    {
        // ...
    }
}
```

## Parameters

- `route` ([YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md))
- `queryKey` (`string`)
- `value` (`string`)
- `append` (`bool`) `optional`

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
