DataEntryTagRoleEmployee.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. }
  27. }