Implementing the Adapter pattern

In this example, we’ll use the concept of electric sockets. We’ll mimic the use of a socket adapter in the code.

Creating a standard application

We‘ll create a standard .NET console application. Then, we’ll add the IElectricSocket.cs file to it. The file will contain the following empty interface definition:

Get hands-on with 1400+ tech skills courses.