# Adapter Pattern

A pattern that makes one interface look like another, like a travel plug adapter.

## What is **Adapter Pattern**?

The **Adapter pattern** makes one interface look like another, like a travel plug adapter. It lets your code use a library whose methods don't match what your code expects.

```csharp
public class WeatherApiAdapter : IWeatherService
{
    private readonly ThirdPartyWeatherClient client = new();
    public int TodayHigh() => (int)client.FetchForecast().Days[0].MaxTempC;
}
```

Level: Freelancer · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/freelancer)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/adapter-pattern
