static void Main(string[] args) { var obj = new ConcreteDecorator1( new ConcreteDecorator2( new ConcreteDecorator2( new ConcreteComponent()))); var a = obj.MethodA(); var b = a; }
/// <summary> /// Retrieves data bysed on "key" /// </summary> /// <param name="key"></param> /// <returns></returns> public static DataRetrievalResult GetMyData(string key) { IDataRetrieverDA da = GetImplOfRetriever(); Decorator decorator1 = new ConcreteDecorator1(); decorator1.DataRetrieverDA = da; return(decorator1.GetDataBasedOnKey(key)); }