MailNotification.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace GreenTree.Nachtragsmanagement.Core.Domain.Misc
  7. {
  8. public class MailNotification : BaseEntity
  9. {
  10. #region Fields
  11. /// <summary>
  12. /// Users related to the notification
  13. /// </summary>
  14. private ICollection<User.User> _users;
  15. #endregion
  16. /// <summary>
  17. /// The cron expression if the notification will be sent by time
  18. /// </summary>
  19. public string CronExpression { get; set; }
  20. /// <summary>
  21. /// The system name of the corresponding plugin generating the notification
  22. /// </summary>
  23. public string NotificationPluginSystemName { get; set; }
  24. /// <summary>
  25. /// The system name of the job that should be processed by the corresponding notification plugin
  26. /// </summary>
  27. public string NotificationJobSystemName { get; set; }
  28. /// <summary>
  29. /// Users assigned to the notification
  30. /// </summary>
  31. public virtual ICollection<User.User> Users
  32. {
  33. get { return _users ?? ( _users = new List<User.User>()); }
  34. protected set { _users = value; }
  35. }
  36. #region Helper
  37. /// <summary>
  38. /// Adds missing users and removes not selected users
  39. /// </summary>
  40. /// <param name="users">Site users.</param>
  41. public void SetUsers(ICollection<User.User> users)
  42. {
  43. Users = users;
  44. }
  45. #endregion
  46. }
  47. }