Adapter — convert interface.
Implementation:
1public interface ITarget2{3 string GetResult();4}56public class LegacyService7{8 public string GetData() => "legacy data";9}1011public class ServiceAdapter : ITarget12{13 private readonly LegacyService _service;1415 public ServiceAdapter(LegacyService service) =>16 _service = service;1718 public string GetResult() => _service.GetData();19}
Key: Adapter for interface compatibility.