how i brew formula twin linq queries?
i'm maybe being bit idle seeking here, nonetheless i'm only removing started linq i have duty i am certain incited twin linq queries (or nested query) rather linq integrate foreach statements. any linq gurus caring refactor me an example?
the duty itself loops by list .csproj files pulls out paths .cs files enclosed project:
static ienumerable<string> findfiles(ienumerable<string> projectpaths)
{
twine xmlnamespace = "{http://schemas.microsoft.com/developer/msbuild/2003}";
foreach (string projectpath projectpaths)
{
xdocument projectxml = xdocument.load(projectpath);
twine projectdir = path.getdirectoryname(projectpath);
var csharpfiles = c projectxml.descendants(xmlnamespace + "compile")
where c.attribute("include").value.endswith(".cs")
name path.combine(projectdir, c.attribute("include").value);
foreach (string s csharpfiles)
{
furnish relapse s;
}
}
}
Comments
Post a Comment