BaseIntegrationSource.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public interface IBaseIntegrationSource
  6. {
  7. string? Code { get; set; }
  8. string? Description { get; set; }
  9. IEntityLink Entity { get; }
  10. IntegrationSourceType Source { get; set; }
  11. }
  12. public abstract class BaseIntegrationSource<TEntity,TLink> : Entity, IRemotable, IPersistent, IOneToMany<TEntity>, IBaseIntegrationSource
  13. where TEntity : Entity
  14. where TLink : IEntityLink<TEntity>
  15. {
  16. public Type EntityType() => typeof(TEntity);
  17. [NullEditor]
  18. [EntityRelationship(DeleteAction.Cascade)]
  19. [RequiredColumn]
  20. public TLink Entity { get; set; }
  21. IEntityLink IBaseIntegrationSource.Entity => Entity;
  22. [EditorSequence(1)]
  23. [EnumLookupEditor(typeof(IntegrationSourceType), Visible = Visible.Default, Width = 100)]
  24. public IntegrationSourceType Source { get; set; }
  25. [EditorSequence(2)]
  26. [TextBoxEditor]
  27. public string? Code { get; set; }
  28. [EditorSequence(3)]
  29. [TextBoxEditor]
  30. public string? Description{ get; set; }
  31. [DoNotPersist]
  32. [NullEditor]
  33. public bool DirectMatch { get; set; }
  34. }
  35. }