本文整理汇总了C#中QueryBuilder.ApplyTo方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.ApplyTo方法的具体用法?C# QueryBuilder.ApplyTo怎么用?C# QueryBuilder.ApplyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.ApplyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AircraftLeaseOrderQuery
/// <summary>
/// <see cref="IOrderQuery" />
/// </summary>
/// <param name="query">
/// <see cref="IOrderQuery" />
/// </param>
/// <returns>
/// <see cref="IOrderQuery" />
/// </returns>
public IQueryable<AircraftLeaseOrderDTO> AircraftLeaseOrderQuery(QueryBuilder<Order> query)
{
var trades = _unitOfWork.CreateSet<Trade>();
var result = query.ApplyTo(_orderRepository.GetAll().OfType<AircraftLeaseOrder>().Where(p => p.IsValid))
.Select(o => new AircraftLeaseOrderDTO
{
Id = o.Id,
Name = o.Name,
Version = o.Version,
CurrencyId = o.Currency.Id,
OperatorName = o.OperatorName,
OrderDate = o.OrderDate,
Status = (int) o.Status,
Note = o.Note,
SupplierId = trades.FirstOrDefault(p => p.Id == o.TradeId).SupplierId,
SupplierName = trades.FirstOrDefault(p => p.Id == o.TradeId).Supplier.CnName,
AircraftLeaseOrderLines =
o.OrderLines.OfType<AircraftLeaseOrderLine>().Select(l => new AircraftLeaseOrderLineDTO
{
Id = l.Id,
UnitPrice = l.UnitPrice,
Amount = l.Amount,
Discount = l.Discount,
EstimateDeliveryDate = l.EstimateDeliveryDate,
Note = l.Note,
ContractAircraftId = l.ContractAircraftId,
OrderId = l.OrderId,
TotalLine = (l.UnitPrice*l.Amount)*(1 - (l.Discount/100M)),
}).ToList(),
});
return result;
}
示例2: EnginePaymentSchedulesQuery
public IQueryable<EnginePaymentScheduleDTO> EnginePaymentSchedulesQuery(QueryBuilder<PaymentSchedule> query)
{
var dbCurrency = _unitOfWork.CreateSet<Currency>();
return
query.ApplyTo(_unitOfWork.CreateSet<PaymentSchedule>())
.OfType<EnginePaymentSchedule>()
.Select(p => new EnginePaymentScheduleDTO
{
EnginePaymentScheduleId = p.Id,
CreateDate = p.CreateDate,
CurrencyId = p.CurrencyId,
IsCompleted = p.IsCompleted,
SupplierId = p.SupplierId,
SupplierName = p.SupplierName,
ContractEngineId = p.ContractEngineId,
CurrencyName = dbCurrency.FirstOrDefault(c => c.Id == p.CurrencyId).CnName,
PaymentScheduleLines = p.PaymentScheduleLines.Select(c => new PaymentScheduleLineDTO
{
PaymentScheduleLineId = c.Id,
Amount = c.Amount,
Start = c.Start,
End = c.End,
Body = c.Body,
Subject = c.Subject,
PaymentScheduleId = c.PaymentScheduleId,
ScheduleDate = c.ScheduleDate,
Status = (int) c.Status,
Importance = c.Importance,
ProcessStatus = c.Tempo,
InvoiceId = c.InvoiceId,
IsAllDayEvent = c.IsAllDayEvent
}).ToList(),
});
}
示例3: PlanAircraftDTOQuery
/// <summary>
/// 计划飞机查询。
/// </summary>
/// <param name="query">查询表达式</param>
/// <returns>PlanAircraftDTO集合</returns>
public IQueryable<PlanAircraftDTO> PlanAircraftDTOQuery(QueryBuilder<PlanAircraft> query)
{
var ps = _unitOfWork.CreateSet<Plan>();
var phs = _unitOfWork.CreateSet<PlanHistory>();
return query.ApplyTo(_unitOfWork.CreateSet<PlanAircraft>()).Select(p => new PlanAircraftDTO
{
Id = p.Id,
AircraftId = p.AircraftId,
ContractAircraftId = p.ContractAircraftId,
AircraftTypeId = p.AircraftTypeId,
IsLock = p.IsLock,
IsOwn = p.IsOwn,
Status = (int) p.Status,
Regional = p.AircraftType.AircraftCategory.Regional,
AircraftTypeName = p.AircraftType.Name,
PlanHistories = (from ph in phs
join pl in ps on ph.PlanId equals pl.Id
select new PlanHistoryDTO
{
Id = ph.Id,
PlanAircraftId = ph.PlanAircraftId.Value,
PlanYear = pl.Annual.Year,
VersionNumber = pl.VersionNumber,
PerformAnnual = ph.PerformAnnual.Year,
PerformMonth = ph.PerformMonth,
ActionType = ph.TargetCategory.ActionType,
ActionName = ph.TargetCategory.ActionName
}).Where(plh => plh.PlanAircraftId == p.Id).ToList()
});
}
示例4: CaacProgrammingDTOQuery
/// <summary>
/// 民航局五年规划查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>民航局五年规划DTO集合。</returns>
public IQueryable<CaacProgrammingDTO> CaacProgrammingDTOQuery(
QueryBuilder<CaacProgramming> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<CaacProgramming>()).Select(p => new CaacProgrammingDTO
{
Id = p.Id,
CreateDate = p.CreateDate,
DocName = p.DocName,
DocNumber = p.DocNumber,
DocumentId = p.DocumentId,
IssuedDate = p.IssuedDate,
IssuedUnitId = p.IssuedUnitId,
Name = p.Name,
Note = p.Note,
ProgrammingId = p.ProgrammingId,
ProgrammingName = p.Programming.Name,
CaacProgrammingLines = p.CaacProgrammingLines.Select(q => new CaacProgrammingLineDTO
{
Id = q.Id,
AircraftCategoryId = q.AircraftCategoryId,
CaacProgrammingId = q.CaacProgrammingId,
Number = q.Number,
Year = q.Year,
}).ToList(),
});
}
示例5: ScnDTOQuery
/// <summary>
/// Scn查询。
/// </summary>
/// <param name="query">查询表达式</param>
/// <returns>ScnDTO集合</returns>
public IQueryable<ScnDTO> ScnDTOQuery(QueryBuilder<Scn> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<Scn>()).Select(p => new ScnDTO
{
Id = p.Id,
Title = p.Title,
CSCNumber = p.CSCNumber,
CheckDate = p.CheckDate,
Cost = p.Cost,
Description = p.Description,
ModNumber = p.ModNumber,
RfcNumber = p.RfcNumber,
ScnDocumentId = p.ScnDocumentId,
ScnDocName = p.ScnDocName,
ScnNumber = p.ScnNumber,
Type = (int)p.Type,
ScnType = (int)p.ScnType,
ValidDate = p.ValidDate,
ReceiveDate = p.ReceiveDate,
ScnStatus = (int)p.ScnStatus,
AuditHistory = p.AuditHistory,
ApplicableAircrafts = p.ApplicableAircrafts.Select(q => new ApplicableAircraftDTO
{
Id = q.Id,
ApplicableAircraftName = q.ContractAircraft.ContractNumber+q.ContractAircraft.RankNumber,
CompleteDate = q.CompleteDate,
Cost = q.Cost,
ContractAircraftId = q.ContractAircraftId,
ScnId = q.ScnId,
}).ToList(),
});
}
示例6: EngineMaintainPlanDTOQuery
/// <summary>
/// EngineMaintainPlan查询。
/// </summary>
/// <param name="query">查询表达式</param>
/// <returns>EngineMaintainPlanDTO集合</returns>
public IQueryable<EngineMaintainPlanDTO> EngineMaintainPlanDTOQuery(QueryBuilder<EngineMaintainPlan> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<EngineMaintainPlan>()).Select(p => new EngineMaintainPlanDTO
{
Id = p.Id,
AnnualId = p.AnnualId,
BudgetManager = p.BudgetManager,
CompanyLeader = p.CompanyLeader,
DepartmentLeader = p.DepartmentLeader,
DollarRate = p.DollarRate,
MaintainPlanType = p.MaintainPlanType,
PhoneNumber = p.PhoneNumber,
EngineMaintainPlanDetails = p.EngineMaintainPlanDetails.Select(q => new EngineMaintainPlanDetailDTO
{
Id = q.Id,
ChangeLlpFee = q.ChangeLlpFee,
ChangeLlpNumber = q.ChangeLlpNumber,
CustomsTax = q.CustomsTax,
EngineNumber = q.EngineNumber,
FreightFee = q.FreightFee,
InMaintainDate = q.InMaintainDate,
MaintainLevel = q.MaintainLevel,
NonFhaFee = q.NonFhaFee,
Note = q.Note,
OutMaintainDate = q.OutMaintainDate,
PartFee = q.PartFee,
TsnCsn = q.TsnCsn,
TsrCsr = q.TsrCsr,
FeeLittleSum = q.FeeLittleSum,
FeeTotalSum = q.FeeTotalSum,
BudgetToalSum = q.BudgetToalSum
}).ToList(),
});
}
示例7: InstallControllerDTOQuery
/// <summary>
/// 装机控制查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>装机控制DTO集合。</returns>
public IQueryable<InstallControllerDTO> InstallControllerDTOQuery(
QueryBuilder<InstallController> query)
{
var pnReg = _unitOfWork.CreateSet<PnReg>();
return query.ApplyTo(_unitOfWork.CreateSet<InstallController>()).Select(p => new InstallControllerDTO
{
Id = p.Id,
ItemId = p.ItemId,
ItemNo = p.Item.ItemNo,
ItemName = p.Item.Name,
PnRegId = p.PnRegId,
Pn = p.PnReg.Pn,
Description = p.PnReg.Description,
AircraftTypeId = p.AircraftTypeId,
AircraftTypeName = p.AircraftType.Name,
StartDate = p.StartDate,
EndDate = p.EndDate,
Dependencies = p.Dependencies.Select(q=>new DependencyDTO
{
Id = q.Id,
DependencyPnId = q.DependencyPnId,
InstallControllerId = q.DependencyPnId,
Pn = q.Pn,
Description = pnReg.FirstOrDefault(l=>l.Id==q.DependencyPnId).Description,
}).ToList(),
});
}
示例8: PurchaseContractAircraftDTOQuery
/// <summary>
/// 采购合同飞机查询
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>采购合同飞机DTO集合。</returns>
public IQueryable<PurchaseContractAircraftDTO> PurchaseContractAircraftDTOQuery(
QueryBuilder<PurchaseContractAircraft> query)
{
return
query.ApplyTo(_unitOfWork.CreateSet<ContractAircraft>().OfType<PurchaseContractAircraft>())
.Select(p => new PurchaseContractAircraftDTO
{
PurchaseContractAircraftId = p.Id,
ContractName = p.ContractName,
ContractNumber = p.ContractNumber,
RankNumber = p.RankNumber,
CSCNumber = p.CSCNumber,
SerialNumber = p.SerialNumber,
IsValid = p.IsValid,
ReceivedAmount = p.ReceivedAmount,
AcceptedAmount = p.AcceptedAmount,
AircraftTypeId = p.AircraftTypeId,
AircraftTypeName = p.AircraftType.Name,
PlanAircraftID = p.PlanAircraftID,
ImportCategoryId = p.ImportCategoryId,
ImportType = p.ImportCategory.ActionType,
ImportActionName = p.ImportCategory.ActionName,
SupplierId = p.SupplierId,
});
}
示例9: UsersQuery
/// <summary>
/// User查询。
/// </summary>
/// <param name="query">查询表达式</param>
/// <returns>UserDTO集合</returns>
public IQueryable<UserDTO> UsersQuery(QueryBuilder<User> query)
{
var dbOrganization = _unitOfWork.CreateSet<Organization>().OrderByDescending(p => p.Code);
return query.ApplyTo(_unitOfWork.CreateSet<User>()).Select(p => new UserDTO
{
Id = p.Id,
DisplayName = p.DisplayName,
CreateDate = p.CreateDate,
Description = p.Comment,
Email = p.Email,
UserName = p.UserName,
OrganizationNo = p.OrganizationNo,
Mobile = p.Mobile,
Password = p.Password,
PasswordConfirm = p.Password,
OrganizationName = dbOrganization.FirstOrDefault(t => p.OrganizationNo.Equals(t.Code)).Name,
IsSystemUser = p.IsSystemUser,
UserRoles = p.UserRoles.Select(q => new UserRoleDTO
{
Id = q.Id,
RoleId = q.RoleId,
UserId = q.UserId
}).ToList()
});
}
示例10: MaintainCreditNoteDTOQuery
/// <summary>
/// 贷项单查询
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>贷项单DTO集合。</returns>
public IQueryable<MaintainCreditNoteDTO> MaintainCreditNoteDTOQuery(
QueryBuilder<MaintainCreditNoteInvoice> query)
{
return
query.ApplyTo(_unitOfWork.CreateSet<MaintainCreditNoteInvoice>())
.Select(p => new MaintainCreditNoteDTO
{
CreditNoteId = p.Id,
InvoiceNumber = p.InvoiceNumber,
InvoideCode = p.InvoideCode,
InvoiceDate = p.InvoiceDate,
SupplierName = p.SupplierName,
SupplierId = p.SupplierId,
InvoiceValue = p.InvoiceValue,
PaidAmount = p.PaidAmount,
OperatorName = p.OperatorName,
Reviewer = p.Reviewer,
CreateDate = p.CreateDate,
ReviewDate = p.ReviewDate,
IsValid = p.IsValid,
IsCompleted = p.IsCompleted,
Status = (int)p.Status,
CurrencyId = p.CurrencyId,
PaymentScheduleLineId = p.PaymentScheduleLineId,
InvoiceLines = p.InvoiceLines.Select(q => new InvoiceLineDTO
{
InvoiceLineId = q.Id,
ItemName = (int)q.ItemName,
Amount = q.Amount,
InvoiceId = q.InvoiceId,
OrderLineId = q.OrderLineId,
Note = q.Note,
}).ToList(),
});
}
示例11: AirStructureDamageDTOQuery
/// <summary>
/// AirStructureDamage查询。
/// </summary>
/// <param name="query">查询表达式</param>
/// <returns>AirStructureDamageDTO集合</returns>
public IQueryable<AirStructureDamageDTO> AirStructureDamageDTOQuery(QueryBuilder<AirStructureDamage> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<AirStructureDamage>()).Select(p => new AirStructureDamageDTO
{
Id = p.Id,
AircraftId = p.AircraftId,
AircraftReg = p.Aircraft.RegNumber,
AircraftSeries = p.AircraftSeries,
AircraftType = p.AircraftType,
CloseDate = p.CloseDate,
Description = p.Description,
DocumentName = p.DocumentName,
IsDefer = p.IsDefer,
Level = (int)p.Level,
RepairDeadline = p.RepairDeadline,
ReportDate = p.ReportDate,
ReportNo = p.ReportNo,
ReportType = (int)p.ReportType,
Source = p.Source,
Status = (int)p.Status,
TecAssess = p.TecAssess,
TotalCost = p.TotalCost,
TreatResult = p.TreatResult,
DocumentId = p.DocumentId
});
}
示例12: AirProgrammingDTOQuery
/// <summary>
/// 航空公司五年规划查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>航空公司五年规划DTO集合。</returns>
public IQueryable<AirProgrammingDTO> AirProgrammingDTOQuery(
QueryBuilder<AirProgramming> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<AirProgramming>()).Select(p => new AirProgrammingDTO
{
Id = p.Id,
CreateDate = p.CreateDate,
DocName = p.DocName,
DocumentId = p.DocumentId,
IssuedDate = p.IssuedDate,
IssuedUnitId = p.IssuedUnitId,
Name = p.Name,
Note = p.Note,
ProgrammingId = p.ProgrammingId,
ProgrammingName = p.Programming.Name,
AirProgrammingLines = p.AirProgrammingLines.Select(q=>new AirProgrammingLineDTO
{
Id = q.Id,
AircraftSeriesId = q.AircraftSeriesId,
AirProgrammingId = q.AirProgrammingId,
BuyNum = q.BuyNum,
ExportNum = q.ExportNum,
LeaseNum = q.LeaseNum,
Year = q.Year,
}).ToList(),
});
}
示例13: AircraftConfigurationDTOQuery
/// <summary>
/// 飞机配置查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>飞机配置DTO集合。</returns>
public IQueryable<AircraftConfigurationDTO> AircraftConfigurationDTOQuery(
QueryBuilder<AircraftConfiguration> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<AircraftConfiguration>()).Select(p => new AircraftConfigurationDTO
{
Id = p.Id,
AircraftSeriesId = p.AircraftSeriesId,
AircraftTypeId = p.AircraftTypeId,
BEW = p.BEW,
BW = p.BW,
BWF = p.BWF,
BWI = p.BWI,
ConfigCode = p.ConfigCode,
Description = p.Description,
FileContent = p.FileContent,
FileName = p.FileName,
MCC = p.MCC,
MLW = p.MLW,
MMFW = p.MMFW,
MTOW = p.MTOW,
MTW = p.MTW,
MZFW = p.MZFW,
AircraftCabins = p.AircraftCabins.Select(q=>new AircraftCabinDTO
{
Id = q.Id,
AircraftCabinTypeId = q.AircraftCabinTypeId,
SeatNumber = q.SeatNumber,
Note = q.Note
}).ToList(),
});
}
示例14: EnginePlanDTOQuery
/// <summary>
/// 备发计划查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>备发计划DTO集合。</returns>
public IQueryable<EnginePlanDTO> EnginePlanDTOQuery(
QueryBuilder<EnginePlan> query)
{
return query.ApplyTo(_unitOfWork.CreateSet<EnginePlan>()).Select(p => new EnginePlanDTO
{
Id = p.Id,
AirlinesId = p.AirlinesId,
AnnualId = p.AnnualId,
CreateDate = p.CreateDate,
DocName = p.DocName,
DocNumber = p.DocNumber,
DocumentId = p.DocumentId,
IsValid = p.IsValid,
Note = p.Note,
Status = (int)p.Status,
Title = p.Title,
VersionNumber = p.VersionNumber,
EnginePlanHistories = p.EnginePlanHistories.Select(q=>new EnginePlanHistoryDTO
{
Id = q.Id,
ActionCategoryId = q.ActionCategoryId,
EnginePlanId = q.EnginePlanId,
EngineTypeId = q.EngineTypeId,
IsFinished = q.IsFinished,
MaxThrust = q.MaxThrust,
ImportDate = q.ImportDate,
Note = q.Note,
PerformAnnualId = q.PerformAnnualId,
PerformMonth = q.PerformMonth,
PlanEngineId = q.PlanEngineId,
Status = (int)q.Status,
}).ToList(),
}).OrderBy(p=>p.CreateDate);
}
示例15: SnHistoryDTOQuery
/// <summary>
/// 序号件装机历史查询。
/// </summary>
/// <param name="query">查询表达式。</param>
/// <returns>序号件装机历史DTO集合。</returns>
public IQueryable<SnHistoryDTO> SnHistoryDTOQuery(
QueryBuilder<SnHistory> query)
{
var dbAircrafts = _unitOfWork.CreateSet<Aircraft>();
return query.ApplyTo(_unitOfWork.CreateSet<SnHistory>()).Select(p => new SnHistoryDTO
{
Id = p.Id,
Sn = p.Sn,
SnRegId = p.SnRegId,
Pn = p.Pn,
PnRegId = p.PnRegId,
CSN = p.CSN,
TSN = p.TSN,
CSN2 = p.CSN2,
TSN2 = p.TSN2,
Status = (int)p.Status,
Position = (int)p.Position,
AircraftId = p.AircraftId,
ActionDate = p.ActionDate,
ActionType = (int)p.ActionType,
ActionNo = p.RemInstRecord.ActionNo,
ActionReason = p.RemInstRecord.Reason,
RemInstRecordId = p.RemInstRecordId,
RegNumber = dbAircrafts.FirstOrDefault(c => c.Id == p.AircraftId).RegNumber,
});
}