internal static IEnumerable <Expression <Func <Contract, ContractDetailReturn> > > SelectDetail() { var item = ContractItemProjectors.Select(); var notebook = NotebookProjectors.Select(); return(SelectContractBase().Select(c => c.Merge(Projector <Contract> .To(n => new ContractDetailReturn { }))) .ToAppendedList(Projector <Contract> .To(c => new ContractDetailReturn { NotesToPrint = c.NotesToPrint, ContactAddress = c.ContactAddress, Comments = notebook.Invoke(c.Comments) })) .ToAppendedList(item.Select(itemProjector => Projector <Contract> .To(c => new ContractDetailReturn { ContractItems = c.ContractItems.Select(i => itemProjector.Invoke(i)) })))); }
internal static IEnumerable <Expression <Func <Contract, ContractShipmentSummaryReturn> > > SplitSelectShipmentSummary() { var key = SelectKey(); return(ContractItemProjectors.SplitSelectShipmentSummary() .Select(p => Projector <Contract> .To(c => new ContractShipmentSummaryReturn { CustomerName = c.Customer.Company.Name, ContractType = c.ContractType, Items = c.ContractItems.Select(i => p.Invoke(i)) })) .ToAppendedList(Projector <Contract> .To(c => new ContractShipmentSummaryReturn { ContractKeyReturn = key.Invoke(c), ContractNumber = c.ContractId, ContractStatus = c.ContractStatus, TermBegin = c.TermBegin, TermEnd = c.TermEnd }))); }