日期:2014-05-20  浏览次数:20771 次

LINQ to ENTITY 一个多表查询
下面是我的查询语句

            List<Query360UnitDataContract> list = (from RentalUnit in TempRentalUnitEntityList
                                                   join RentalContract in TempRentalContractEntityList on RentalUnit.RentalID equals RentalContract.RentalID
                                                   join Account in TempAccountEntityList on RentalContract.AccountID equals Account.AccountID
                                                   join Unit in TempUnitEntityList on RentalUnit.RefRecordID equals Unit.UnitID
                                                   join Company in TempCompanyEntityList on Unit.PropertyCompanyID equals Company.CompanyID

                                                   select new Query360UnitDataContract
                                                   {
                                                       UnitID = Unit.UnitID,
                                                       UnitNo = Unit.UnitNo,
                                                       BuildUpArea = Unit.BuildUpArea,
                                                       RecordStatus = Unit.RecordStatus,