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; public override Column[] IDColumns => new Column[] { new Column(x => x.Employee.ID), new Column(x => x.Form.ID) }; } [UserTracking(typeof(Employee))] [AutoEntity(typeof(EmployeeDigitalFormCrossGenerator))] public class EmployeeDigitalForm : Entity, IRemotable, IPersistent, IEmployeeDigitalForm, ILicense { public EmployeeLink Employee { get; set; } public DigitalFormLink Form { get; set; } } }