I have 2 lists groupoptions and dataIndicator
class groupoptions{
...
GroupName string
}
class dataIndicator{
...
HeaderID int
IndicatorDescription
}
currently my groupname possible values are 4 or 5 or 11
first i want to get all dataindicators where headerid is equal to GroupName, then replace those GroupNames with dataindicator's IndicatorDescription
What would be the Linq syntax for this?
UPDATE
using join
var newList = from first in dataIndicator
join second in groupedoptions
on first.HeaderID.ToString() equals second.GroupName
select new { first,second };
What next? PROBLEM: i want to do it inside a constructor that is being created inside a Linq Select
var list = xyz.Select(x => new groupoptions(){
GroupName = x.Key.ToString();
})