I am trying to create an instance of a class using Linq and XML. I am getting the following error in my code and do not know how to fix it. My code editor is telling me the "select" in the following code is the culprit. I am very new to Linq so any help is appreciated.
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'gcDiversityVision.VisionData'. An explicit conversion exists (are you missing a cast?)
XElement visionXML = XElement.Parse(e.Result);
VisionData newVisionData = new VisionData(new List<string>(visionXML.Descendants(ns + "Employee").Select(f => f.Element(ns + "EmployeeName").Value)),
new List<string>(visionXML.Descendants(ns + "Employee").Select(f => f.Element(ns + "EmployeeTitle").Value)),
new List<string>(visionXML.Descendants(ns + "Employee").Select(f => f.Element(ns + "include").Attribute("externalPath").Value)),
new List<string>(visionXML.Descendants(ns + "Employee").Select(f => f.Element(ns + "EmployeeVideo").Value)),
visionXML.Element(ns + "LinkHeaderText").Value,
visionXML.Element(ns + "ButtonLinkText").Value,
visionXML.Element(ns + "ButtonLinkURL").Value,
new List<string>(visionXML.Descendants(ns + "Links").Select(f => f.Element(ns + "LinkURL").Value)),
new List<string>(visionXML.Descendants(ns + "Links").Select(f => f.Element(ns + "LinkText").Value)),
new List<string>(visionXML.Descendants(ns + "EmployeeStoryHeaderParagraph").Select(f => f.Element(ns + "EmployeeHeader").Value)),
new List<string[]>(visionXML.Descendants(ns + "EmployeeStoryHeaderParagraph").Select(f => f.Descendants(ns + "EmployeeParagraphs").Select(ep => ep.Element(ns + "EmployeeParagraph").Value).ToArray()))
);
<c:gcDiversityVision>
<c:Employee>
<c:EmployeeName>Employee Name 1</c:EmployeeName>
<c:EmployeeTitle>EmployeeTitle 1</c:EmployeeTitle>
<c:EmployeeIconImage>
<c:include type="Image" resolve="false" sourcedFrom="local" externalPath="/global/hrit/Careers/PublishingImages/down_carat.gif" height="7" width="12" query="">/hrit/Careers/PublishingImages/down_carat.gif</c:include>
</c:EmployeeIconImage>
<c:EmployeeVideo>mms://msnvidweb.wmod.msecnd.net/a10026/e1/ds/us/CMG_US/CMG_Microsoft/8F036573-ADAD-40B3-B2A2-A070E6C970B2.wmv</c:EmployeeVideo>
</c:Employee>
<c:Employee>
<c:EmployeeName>Employee Name 2</c:EmployeeName>
<c:EmployeeTitle>Employee Title 2</c:EmployeeTitle>
<c:EmployeeIconImage>
<c:include type="Image" resolve="false" sourcedFrom="local" externalPath="/global/hrit/Careers/PublishingImages/2nav_bg.png" height="29" width="2" query="">/hrit/Careers/PublishingImages/2nav_bg.png</c:include>
</c:EmployeeIconImage>
<c:EmployeeVideo>mms://msnvidweb.wmod.msecnd.net/a10026/e1/ds/us/CMG_US/CMG_Microsoft/BE4A3DF0-15FB-4610-A478-F681FCBE2DFA.wmv</c:EmployeeVideo>
</c:Employee>
<c:VisionParagraph>
<c:VisionHeaderParagraph>
<c:VisionHeader>Vision Header 1</c:VisionHeader>
<c:VisionParagraphs>
<c:VisionParagraph>Vision Paragraph 1.1</c:VisionParagraph>
</c:VisionParagraphs>
<c:VisionParagraphs>
<c:VisionParagraph>Vision Paragraph 1.2</c:VisionParagraph>
</c:VisionParagraphs>
</c:VisionHeaderParagraph>
<c:VisionHeaderParagraph>
<c:VisionHeader>Vision Header 2</c:VisionHeader>
<c:VisionParagraphs>
<c:VisionParagraph>Vision Paragraph 2.1</c:VisionParagraph>
</c:VisionParagraphs>
<c:VisionParagraphs>
<c:VisionParagraph>Vision Paragraph 2.2</c:VisionParagraph>
</c:VisionParagraphs>
</c:VisionHeaderParagraph>
</c:VisionParagraph>
<c:Footer>
<c:Button>
<c:ButtonLinkText>Button Link Text</c:ButtonLinkText>
<c:ButtonLinkURL>http://www.bing.com/</c:ButtonLinkURL>
</c:Button>
<c:LinkHeaderText>Link Text 2</c:LinkHeaderText>
<c:Links>
<c:LinkText>Link Text 1</c:LinkText>
<c:LinkURL>http://www.bing.com/</c:LinkURL>
</c:Links>
<c:Links>
<c:LinkText>Link Text 2</c:LinkText>
<c:LinkURL>http://www.bong.com/</c:LinkURL>
</c:Links>
<c:Links>
<c:LinkText>Link Text 3</c:LinkText>
<c:LinkURL>http://www.bing.com/</c:LinkURL>
</c:Links>
<c:Links>
<c:LinkText>Link Text 4</c:LinkText>
<c:LinkURL>http://www.bong.com/</c:LinkURL>
</c:Links>
</c:Footer>