static void Main(string[] args) { Student modal = RetriveStudentFromDatabase(); StudentView view = new StudentView(); StudentController controller = new StudentController(modal, view); controller.UpdateView(); controller.SetStudentName("Jhon"); controller.UpdateView(); }
/// <summary> /// https://www.tutorialspoint.com/design_pattern/mvc_pattern.htm /// </summary> /// <param name="args"></param> /// static void Main(string[] args) { //fetch student record based on his roll no from the database Student model = RetrieveStudentFromDatabase(); //Create a view : to write student details on console StudentView view = new StudentView(); StudentController controller = new StudentController(model, view); controller.UpdateView(); //update model data controller.SetStudentName("John"); controller.UpdateView(); }
public static void Demo() { //fetch student record based on his roll no from the database Student s = new Student() { Name = "A", ID = 1 }; //Create a view : to write student details on console StudentView v = new StudentView(); StudentController sc = new StudentController(s, v); sc.UpdateView(); //update model sc.SetName("B"); sc.UpdateView(); Console.Read(); }
public StudentController(Student modal, StudentView view) { _studentModal = modal; _studentViewModal = view; }
public StudentController(Student model, StudentView view) { this.model = model; this.view = view; }