KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This is my function: private IEnumerable<string> SeachItem(int[] ItemIds) { using (var reader = File.OpenText(Application.StartupPath + @"\temp\A_A.tmp")) { var myLine = from line in ReadLines(reader) where line.Length > 1 let id = int.Parse(line.Split('\t')[1]) where ItemIds.Contains(id) let m = Regex.Match(line, @"^\d+\t(\d+)\t.+?\t(item\\[^\t]+\.ddj)") where m.Success == true select new { Text = line, ItemId = id, Path = m.Groups[2].Value }; return myLine; } } I get a compile error,because "myLine" is not a IEnumerable[string] and I don't know how to write IEnumerable[Anonymous] "Cannot implicitly convert type 'System.Collections.Generic.IEnumerable[AnonymousType#1]' to 'System.Collections.Generic.IEnumerable[string]'"
Tags (comma-separated)
Save Edits
Cancel