I want to return a list of string values from an XElement collection and I get this error when constructing my code and don't see what I'm missing.
Here's a section of the class I've written concering the problem:
private XElement _viewConfig;
public ViewConfiguration(XElement vconfig)
{
_viewConfig = vconfig;
}
public List<string> visibleSensors()
{
IEnumerable<string> sensors = (from el in _viewConfig
where el.Attribute("type").Value == "valueModule"
&& el.Element.Attribute("visible") = true
select el.Element.Attribute("name").Value);
return sensors.ToList<string>();
}
The XElement collection is of the form
<module name="temperature" type="valueModule" visible="true"></module>
<module name="lightIntensity" type="valueModule" visible="true"></module>
<module name="batteryCharge" type="valueModule" visible="true"></module>
<module name="VsolarCells" type="valueModule" visible="false"></module>