I have this IQueryable that get some properties from my table, but it has a group new and I want to concatenate two string from there.
from comp in companies
join con in contacts on new { A = comp.Company_ID, B = comp.Location_ID } equals new { A = con.Company_ID, B = con.Location_ID } into comp_con
group new { comp, cc } by new
{
comp.Company_ID,
comp.Location_ID,
comp.Company_Name,
comp.City,
comp.State,
comp.Total_Fleet_Range,
comp.Total_Locations
} into gcomp
select new MyObject
{
...,
PropertyConcatenated = gcomp.Key.State + gcomp.Key.City // This is the part that doesn't work
};
When I try to make it a list, I got a null reference exception, but both the city and the state have values.