EntityDocumentShell.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using InABox.Core;
  3. namespace InABox.Mobile
  4. {
  5. public abstract class EntityDocumentShell<TModel,TEntity, TEntityLink, TDocument> : Shell<TModel, TDocument>, IEntityDocumentShell
  6. where TModel : ICoreRepository
  7. where TEntity : Entity, IPersistent, IRemotable
  8. where TEntityLink : IEntityLink<TEntity>
  9. where TDocument : Entity, IPersistent, IRemotable, IEntityDocument<TEntityLink>, new()
  10. {
  11. protected override void ConfigureColumns(ShellColumns<TModel, TDocument> columns)
  12. {
  13. columns
  14. .Map(nameof(ParentID), x => x.EntityLink.ID)
  15. .Map(nameof(DocumentID), x => x.DocumentLink.ID)
  16. .Map(nameof(FileName), x => x.DocumentLink.FileName)
  17. .Map(nameof(Thumbnail), x => x.Thumbnail);
  18. }
  19. public Guid ParentID
  20. {
  21. get => Get<Guid>();
  22. set => Set(value);
  23. }
  24. public Guid DocumentID
  25. {
  26. get => Get<Guid>();
  27. set => Set(value);
  28. }
  29. public String FileName
  30. {
  31. get => Get<String>();
  32. set => Set(value);
  33. }
  34. public byte[] Thumbnail
  35. {
  36. get => Get<byte[]>();
  37. set => Set(value);
  38. }
  39. }
  40. }