This short article shows you have to build the Adapter Pattern using C#.
After gone through all the samples, The one in from http://www.dofactory.com/net/adapter-design-pattern and I feel is easier to understand.
The UML diagram as below.
As first the Target is created.
public virtual void Request()
Console.WriteLine(“Called Target Request()”);
Then create the Adapter class inherit from the Target class.
class Adapter : Target
private Adaptee _adaptee = new Adaptee();
public override void Request()
// Possibly do some other work
// and then call SpecificRequest
The last class is the Adaptee referenced by Adapter.
public void SpecificRequest()
The main program will look like below.
static void Main()
// Create adapter and place a request
Target target = new Adapter();
// Wait for user
Some people will start Target as Interface but that is really not a need here.