M
MitchW
Hello,
I have the following code:
DirectoryInfo pdfDirectory = new DirectoryInfo(@"..\Documents");
var files = from f in pdfDirectory.GetFiles("*.pdf")
select new { Filename =
Path.GetFileNameWithoutExtension(f.FullName) };
gvFiles.DataSource = files;
gvFiles.DataBind();
XDocument doc = XDocument.Load(@"..\Documents\FARList.xml");
var matches = from employees in doc.Descendants("employee")
select new { Name =
(string)employees.Attribute("name"), FileName =
(string)employees.Attribute("filenameprefix") };
gvXML.DataSource = matches;
gvXML.DataBind();
I want to find the intersection between these on FileName, but when I do
var finalresult = matches.Intersect(files);
the compiler complains that the type arguments for the method cannot be
inferred.
I am not sure what I am missing?
Any help would be greatly appreciated. Thanks in advance.
--mitch
I have the following code:
DirectoryInfo pdfDirectory = new DirectoryInfo(@"..\Documents");
var files = from f in pdfDirectory.GetFiles("*.pdf")
select new { Filename =
Path.GetFileNameWithoutExtension(f.FullName) };
gvFiles.DataSource = files;
gvFiles.DataBind();
XDocument doc = XDocument.Load(@"..\Documents\FARList.xml");
var matches = from employees in doc.Descendants("employee")
select new { Name =
(string)employees.Attribute("name"), FileName =
(string)employees.Attribute("filenameprefix") };
gvXML.DataSource = matches;
gvXML.DataBind();
I want to find the intersection between these on FileName, but when I do
var finalresult = matches.Intersect(files);
the compiler complains that the type arguments for the method cannot be
inferred.
I am not sure what I am missing?
Any help would be greatly appreciated. Thanks in advance.
--mitch