I am creating a student management system, I need to be able to send a notification on different platforms, such as SMS, email, website, etc. These notification will be sent based on particular events as listed below: • The teacher posted the grade for an assignment • Student is late or absent • A teacher posted a new assignment
Should I have an event handler for each entity or should I have a “NotificationsEventHandler” that handles all the notification generated by updating or creating entities?
//
public class NotificationsEventHandler :
IEventHandler<EntityCreatedEventData<Assignment>>,
IEventHandler<EntityCreatedEventData<Grade>>,
IEventHandler<EntityCreatedEventData<Attendance>>,
.
.
.
{
}
2 Answer(s)
-
0
Hi,
If the notification content changes according to entity, it is better to create event handler for each entity, otherwise you can NotificationsEventHandler.
-
0
Thank you for your help. The content for the notification will be generated by each entity. Each of the following entity will generate a notification.