NotificationShell.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Comal.Classes;
  3. namespace comal.timesheets
  4. {
  5. public class NotificationShell : Shell<NotificationModel,Notification>
  6. {
  7. static NotificationShell()
  8. {
  9. Columns
  10. .Map(nameof(ID), x => x.ID)
  11. .Map(nameof(Created), x => x.Created)
  12. .Map(nameof(Sender), x => x.Sender.Name)
  13. .Map(nameof(Title), x => x.Title)
  14. .Map(nameof(Description), x => x.Description)
  15. .Map(nameof(EntityType), x => x.EntityType)
  16. .Map(nameof(EntityID), x => x.EntityID)
  17. .Map(nameof(Attachments), x=>x.DocumentCount);
  18. }
  19. public Guid ID => Get<Guid>();
  20. public DateTime Created => Get<DateTime>();
  21. public string Sender => Get<String>();
  22. public string Title => Get<String>();
  23. public string Description => Get<String>();
  24. public string EntityType => Get<String>();
  25. public Guid EntityID => Get<Guid>();
  26. public int Attachments => Get<int>();
  27. public bool ImageVisible => Attachments > 0;
  28. }
  29. }