I've got a list of Radios that I'm trying to produce a more user-friendly version of. Behind the scenes all descriptions are stringIds and all part numbers are DB Ids.
Right now, I've got this code:
var z = (from w in wireless
join s in allStrings on w.DescriptionId equals s.StringId
join u in allUids on w.Uid equals u.Uid
where s.LanguageId == 0
select new {w, s, u});
List<RadioProperty> rp = new List<RadioProperty>();
foreach (var x in z)
{
foreach(var y in x.w.RadioToVoltage)
{
rp.Add(new RadioProperty
{
PartNumber = x.u.PartNumber,
Description = x.s.Description,
CurrentType = y.Id.VoltageType,
Voltage = y.Id.VoltageValue,
});
}
}
Basically, every radio part number can have several voltage options. We could have Radio ABC with 48VAC, 110VAC and 240VAC options, so I'm trying to create 3 separate RadioProperty items, one for each voltage option.
Is there a better way of doing this? I'm running .Net 3.5.
Thanks