using System; using System.Collections.Generic; using System.Data.SqlTypes; using System.Linq; using System.Linq.Expressions; using InABox.Core; namespace Comal.Classes { public interface IEmployeeDigitalForm { EmployeeLink Employee { get; set; } DigitalFormLink Form { get; set; } } public class EmployeeDigitalFormCrossGenerator : AutoEntityCrossGenerator { public override Expression> LeftProperty => x => x.EmployeeLink.ID; public override Expression> LeftMapping => x => x.Employee.ID; public override Expression> LeftLink => x => x.RoleLink.ID; public override Expression> RightProperty => x => x.Form.ID; public override Expression> RightMapping => x => x.Form.ID; public override Expression> RightLink => x => x.Role.ID; public override bool Distinct => true; } [UserTracking(typeof(Employee))] [AutoEntity(typeof(EmployeeDigitalFormCrossGenerator))] public class EmployeeDigitalForm : Entity, IRemotable, IPersistent, IEmployeeDigitalForm, ILicense { [EntityRelationship(DeleteAction.Cascade)] public EmployeeLink Employee { get; set; } [EntityRelationship(DeleteAction.Cascade)] public DigitalFormLink Form { get; set; } protected override void Init() { base.Init(); Employee = new EmployeeLink(); Form = new DigitalFormLink(); } } }