DataEntryTagRoleEmployee.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Linq.Expressions;
  3. using InABox.Core;
  4. namespace Comal.Classes
  5. {
  6. public class DataEntryTagRoleEmployeeCrossGenerator : AutoEntityCrossGenerator<IDataEntryTagDistributionEmployee, DataEntryTagRole, EmployeeRole>
  7. {
  8. public override Expression<Func<DataEntryTagRole, Guid>> LeftProperty => x => x.Tag.ID;
  9. public override Expression<Func<IDataEntryTagDistributionEmployee, Guid>> LeftMapping => x => x.Tag.ID;
  10. public override Expression<Func<DataEntryTagRole, Guid>> LeftLink => x => x.Role.ID;
  11. public override Expression<Func<EmployeeRole, Guid>> RightProperty => x => x.EmployeeLink.ID;
  12. public override Expression<Func<IDataEntryTagDistributionEmployee, Guid>> RightMapping => x => x.Employee.ID;
  13. public override Expression<Func<EmployeeRole, Guid>> RightLink => x => x.RoleLink.ID;
  14. public override bool Distinct => true;
  15. public override Column<IDataEntryTagDistributionEmployee>[] IDColumns => new Column<IDataEntryTagDistributionEmployee>[]
  16. {
  17. new Column<IDataEntryTagDistributionEmployee>(x => x.Tag.ID),
  18. new Column<IDataEntryTagDistributionEmployee>(x => x.Employee.ID)
  19. };
  20. }
  21. [AutoEntity(typeof(DataEntryTagRoleEmployeeCrossGenerator))]
  22. public class DataEntryTagRoleEmployee : Entity, IRemotable, IPersistent, IDataEntryTagDistributionEmployee, ILicense<DataEntryLicense>
  23. {
  24. public EmployeeLink Employee { get; set; }
  25. public DataEntryTagLink Tag { get; set; }
  26. protected override void Init()
  27. {
  28. base.Init();
  29. Employee = new EmployeeLink();
  30. Tag = new DataEntryTagLink();
  31. }
  32. }
  33. }