From 3d29c8c17e23c49ac32d098355efd98a9ac47283 Mon Sep 17 00:00:00 2001 From: Natasa Kasikovic~ Date: Sat, 30 Mar 2024 15:35:41 +0100 Subject: [PATCH] [Add] Implementation of TutorController class --- LangLang/Core/Controller/TutorController.cs | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 LangLang/Core/Controller/TutorController.cs diff --git a/LangLang/Core/Controller/TutorController.cs b/LangLang/Core/Controller/TutorController.cs new file mode 100644 index 00000000..04c0cfe0 --- /dev/null +++ b/LangLang/Core/Controller/TutorController.cs @@ -0,0 +1,37 @@ +using LangLang.Core.DAO; +using LangLang.Core.Model; +using LangLang.Core.Observer; +using System.Collections.Generic; + +namespace LangLang.Core.Controller +{ + public class TutorController + { + private readonly TutorDAO _tutors; + + public TutorController() + { + _tutors = new TutorDAO(); + } + + public Dictionary GetAllTutors() + { + return _tutors.GetAllTutors(); + } + + public void Add(Tutor tutor) + { + _tutors.Add(tutor); + } + + public void Delete(int tutorId) + { + _tutors.Remove(tutorId); + } + + public void Subscribe(IObserver observer) + { + _tutors.Subscribe(observer); + } + } +}