1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using Comal.Classes;
- using InABox.Core;
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using System.Text;
- namespace Comal.Classes
- {
- public class ScanTagRoleEmployeeCrossGenerator : AutoEntityCrossGenerator<IScanTagDistributionEmployee, ScanTagRole, EmployeeRole>
- {
- public override Expression<Func<ScanTagRole, Guid>> LeftProperty => x => x.Tag.ID;
- public override Expression<Func<IScanTagDistributionEmployee, Guid>> LeftMapping => x => x.Tag.ID;
- public override Expression<Func<ScanTagRole, Guid>> LeftLink => x => x.Role.ID;
- public override Expression<Func<EmployeeRole, Guid>> RightProperty => x => x.EmployeeLink.ID;
- public override Expression<Func<IScanTagDistributionEmployee, Guid>> RightMapping => x => x.Employee.ID;
- public override Expression<Func<EmployeeRole, Guid>> RightLink => x => x.RoleLink.ID;
- public override bool Distinct => true;
- public override Column<IScanTagDistributionEmployee>[] IDColumns => new Column<IScanTagDistributionEmployee>[]
- {
- new Column<IScanTagDistributionEmployee>(x => x.Tag.ID),
- new Column<IScanTagDistributionEmployee>(x => x.Employee.ID)
- };
- }
- [AutoEntity(typeof(ScanTagRoleEmployeeCrossGenerator))]
- public class ScanTagRoleEmployee : Entity, IRemotable, IPersistent, IScanTagDistributionEmployee, ILicense<DocumentScannerLicense>
- {
- public EmployeeLink Employee { get; set; }
- public ScanTagLink Tag { get; set; }
- protected override void Init()
- {
- base.Init();
- Employee = new EmployeeLink();
- Tag = new ScanTagLink();
- }
- }
- public interface IScanTagDistributionEmployee
- {
- public EmployeeLink Employee { get; set; }
- public ScanTagLink Tag { get; set; }
- }
- public class ScanTagDistributionUnionGenerator : AutoEntityUnionGenerator<IScanTagDistributionEmployee>
- {
- protected override void Configure()
- {
- AddTable<ScanTagEmployee>();
- AddTable<ScanTagRoleEmployee>();
- }
- public override bool Distinct => true;
- public override Column<IScanTagDistributionEmployee>[] IDColumns { get; } = new Column<IScanTagDistributionEmployee>[]
- {
- new Column<IScanTagDistributionEmployee>(x => x.Employee.ID),
- new Column<IScanTagDistributionEmployee>(x => x.Tag.ID)
- };
- }
- [AutoEntity(typeof(ScanTagDistributionUnionGenerator))]
- public class ScanTagDistributionEmployee : Entity, IRemotable, IPersistent, IScanTagDistributionEmployee, ILicense<DocumentScannerLicense>
- {
- public EmployeeLink Employee { get; set; }
- public ScanTagLink Tag { get; set; }
- protected override void Init()
- {
- base.Init();
- Employee = new EmployeeLink();
- Tag = new ScanTagLink();
- }
- }
- }
|