コード例 #1
0
        static void Main(string[] args)
        {
            //NO ADAPTER
            StudentApi sapi = new StudentApi();
            var        xml  = sapi.GetStudentsInXML();

            Console.WriteLine(xml);

            //ADAPTER
            sapi = new StudentApi();
            IStudentApiFormatAdapter adapter = new StudentApiJsonAdapter(sapi);
            var json = adapter.GetStudents();

            Console.WriteLine(json);
        }