generated from kzi-nastava/dotnet-wpf-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Add] Implementation of TutorController class
- Loading branch information
1 parent
f4d7657
commit 3d29c8c
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<int, Tutor> 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); | ||
} | ||
} | ||
} |