I have this query below which works fine in LINQPad but it's giving me an error in my project
var query = from c in corps
join cl in corpsPlaces on c.CorpID equals cl.CorpID into cl_join
from cl in cl_join.DefaultIfEmpty()
join l in places on cl.PlaceID equals l.PlaceID into l_join
from l in l_join.DefaultIfEmpty()
select new
{
c.CorpID,
Name = l.PlaceName == null ? c.CorpName : (l.PlaceName + " - " + c.CropName)
};
I know I am using left join and name can be null therefore I used that conditional operator and the error line
join l in places on cl.PlaceID equals l.PlaceID into l_join
I'm using EF 6, if it matters.
Any help will be appreciated