|
@@ -0,0 +1,52 @@
|
|
|
+using System;
|
|
|
+using System.Linq.Expressions;
|
|
|
+using InABox.Core;
|
|
|
+
|
|
|
+namespace Comal.Classes
|
|
|
+{
|
|
|
+
|
|
|
+ public interface IEmployeeRequiredQualification
|
|
|
+ {
|
|
|
+ EmployeeLink Employee { get; set; }
|
|
|
+
|
|
|
+ QualificationLink Qualification { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ public class EmployeeRequiredQualificationCrossGenerator : AutoEntityCrossGenerator<IEmployeeRequiredQualification,EmployeeRole,RoleQualification>
|
|
|
+ {
|
|
|
+ public override Expression<Func<EmployeeRole, Guid>> LeftProperty => x => x.EmployeeLink.ID;
|
|
|
+ public override Expression<Func<IEmployeeRequiredQualification, Guid>> LeftMapping => x => x.Employee.ID;
|
|
|
+ public override Expression<Func<EmployeeRole, Guid>> LeftLink => x => x.RoleLink.ID;
|
|
|
+
|
|
|
+ public override Expression<Func<RoleQualification, Guid>> RightProperty => x => x.Qualification.ID;
|
|
|
+ public override Expression<Func<IEmployeeRequiredQualification, Guid>> RightMapping => x => x.Qualification.ID;
|
|
|
+ public override Expression<Func<RoleQualification, Guid>> RightLink => x => x.Role.ID;
|
|
|
+
|
|
|
+ public override bool Distinct => true;
|
|
|
+
|
|
|
+ public override Column<IEmployeeRequiredQualification>[] IDColumns => new Column<IEmployeeRequiredQualification>[]
|
|
|
+ {
|
|
|
+ new Column<IEmployeeRequiredQualification>(x => x.Employee.ID),
|
|
|
+ new Column<IEmployeeRequiredQualification>(x => x.Qualification.ID)
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ [UserTracking(typeof(Employee))]
|
|
|
+ [AutoEntity(typeof(EmployeeRequiredQualificationCrossGenerator))]
|
|
|
+ public class EmployeeRequiredQualification : Entity, IRemotable, IPersistent, IEmployeeRequiredQualification,
|
|
|
+ ILicense<CoreLicense>
|
|
|
+ {
|
|
|
+ [EntityRelationship(DeleteAction.Cascade)]
|
|
|
+ public EmployeeLink Employee { get; set; }
|
|
|
+
|
|
|
+ [EntityRelationship(DeleteAction.Cascade)]
|
|
|
+ public QualificationLink Qualification { get; set; }
|
|
|
+
|
|
|
+ protected override void Init()
|
|
|
+ {
|
|
|
+ base.Init();
|
|
|
+ Employee = new EmployeeLink();
|
|
|
+ Qualification = new QualificationLink();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|