public static void Run() { var adapteeLogger = new AdapteeLogger(); var fooAdapter = new ObjectLoggerAdapter(adapteeLogger); var stringAdapter = new MessageLoggerAdapter(adapteeLogger); var range = Enumerable.Range(0, 5); var fooCollection = range.Select(s => new Foo(Guid.NewGuid())); fooAdapter.Log(fooCollection); var messageCollection = range.Select(s => "Messsage - " + Convert.ToBase64String(Guid.NewGuid().ToByteArray())); stringAdapter.Log(messageCollection); }
public MessageLoggerAdapter(AdapteeLogger adapteeLogger) { _adapteeLogger = adapteeLogger; }
public ObjectLoggerAdapter(AdapteeLogger adapteeLogger) { _adapteeLogger = adapteeLogger; }