Reviewing Project Files
Let's take a quick look at Controller class.
- In line 14, it means the class will need a data from EntriesRepository class.
- In line 16, this is a constructor of Controller class that will initialize EntriesRepository when the class being created.
- In line 21, there is an Index() method for our list page, to Read the data.
- There are some functions to Add, Edit and Delete. Edit and Delete could receive an input parameter as null value.
Now, Model class.
- We have 2 model classes, Activity and Entry.
- Activity model contains a constructor, two attributes and list of activities.
- Entry model has those templates too.
Now, Data class.
- Data class has two repository, one for Activities and another for Entries.
- Activities repository class only contains one function, GetActivities().
- In order to maintain the entries from user, Entries Repository class has more function.
- Last, data class stores some local data that waiting to be processed when the project runs.