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