Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Student           model             = RetriveStudentFromDatabase();
            StudentView       view              = new StudentView();
            StudentController studentController = new StudentController()
            {
                model = model, view = view
            };

            studentController.UpdateView();
            studentController.model.name = "Tran Van A";
            studentController.UpdateView();
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Student model = new Student()
            {
                Name   = "Robert",
                RollNo = "10"
            };
            StudentView       view       = new StudentView();
            StudentController controller = new StudentController()
            {
                Model = model,
                View  = view
            };

            controller.UpdateView();
            controller.Model.Name = "John";
            controller.UpdateView();
        }