from u in usergroups from p in u.UsergroupPrices
select new UsergroupPricesList
     {

     UsergroupID= u.UsergroupID,

     UsergroupName= u.UsergroupName,

     Price= p.Price

   }

Left Join

var query =from u in usergroups

join p inUsergroupPrices on u equals p.UsergroupIDinto gj

from x in gj.DefaultIfEmpty()

selectnew{

UsergroupID= u.UsergroupID,

UsergroupName= u.UsergroupName,

Price=(x ==null?String.Empty: x.Price)

};

 

相关文章: