EmployeeRequiredQualification.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Linq.Expressions;
  3. using InABox.Core;
  4. namespace Comal.Classes
  5. {
  6. public interface IEmployeeRequiredQualification
  7. {
  8. EmployeeLink Employee { get; set; }
  9. QualificationLink Qualification { get; set; }
  10. }
  11. public class EmployeeRequiredQualificationCrossGenerator : AutoEntityCrossGenerator<IEmployeeRequiredQualification,EmployeeRole,RoleQualification>
  12. {
  13. public override Expression<Func<EmployeeRole, Guid>> LeftProperty => x => x.EmployeeLink.ID;
  14. public override Expression<Func<IEmployeeRequiredQualification, Guid>> LeftMapping => x => x.Employee.ID;
  15. public override Expression<Func<EmployeeRole, Guid>> LeftLink => x => x.RoleLink.ID;
  16. public override Expression<Func<RoleQualification, Guid>> RightProperty => x => x.Qualification.ID;
  17. public override Expression<Func<IEmployeeRequiredQualification, Guid>> RightMapping => x => x.Qualification.ID;
  18. public override Expression<Func<RoleQualification, Guid>> RightLink => x => x.Role.ID;
  19. public override bool Distinct => true;
  20. public override Column<IEmployeeRequiredQualification>[] IDColumns => new Column<IEmployeeRequiredQualification>[]
  21. {
  22. new Column<IEmployeeRequiredQualification>(x => x.Employee.ID),
  23. new Column<IEmployeeRequiredQualification>(x => x.Qualification.ID)
  24. };
  25. }
  26. [UserTracking(typeof(Employee))]
  27. [AutoEntity(typeof(EmployeeRequiredQualificationCrossGenerator))]
  28. public class EmployeeRequiredQualification : Entity, IRemotable, IPersistent, IEmployeeRequiredQualification,
  29. ILicense<CoreLicense>
  30. {
  31. public EmployeeLink Employee { get; set; }
  32. public QualificationLink Qualification { get; set; }
  33. }
  34. }