Linq中的多表左聯,詳細語句


 from m in context.WX_MemberCollectDish
                              join d in context.Dish on m.DishID equals d.DishID into temp
                              from gc in temp.DefaultIfEmpty()
                              join a in context.AttachMent on new { ParentID = m.DishID } equals new { a.ParentID } into temp2
                              from gc1 in temp2.DefaultIfEmpty()
                              where gc.StoreID == Convert.ToInt32(storeID) && m.MemberID == memberID
                              select new
                              {
                                  UID = gc.UID,
                                  DishID = gc.DishID,
                                  Name = gc.Name,
                                  Price1 = gc.Price1,
                                  FilePath = gc1.WX_FilePath,
                                  WebDishTypeID = gc.WebDishTypeID
                              };


不多解釋了,自己看吧!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM