Skip to content

Suggested project organisation

Koen edited this page Nov 29, 2020 · 1 revision

Triggers can be categorised as validation, initialisation or business logic triggers, however I tend to group them by entity type. This has the advantage of having a central location where all triggers for a specific entity.

A typical project structure will look like this:

/MyProject.Models/Student.cs
/MyProject.Models/Course.cs
...
/MyProject.Triggers/Student/AssignDefaultCreatedDate.cs
/MyProject.Triggers/Student/SignupToMandatoryCourses.cs
/MyProject.Triggers/Course/AssignDefaultCreatedDate.cs
....

Triggers are then named after their purpose. I exclude the type intended audience since that's already given within its parent folder. This allows for a quick overview of what triggers are supposed to run for each Entity.

Clone this wiki locally