Как я могу объединить этот код в один или два запроса LINQ?

если вы передаете все аргументы напрямую, вы можете утверждать, что вам следует просто использовать *args.

def http_get(*args):
    with urllib.request.urlopen(*args) as w:
        return w.read()

http_post = http_get
5
задан Xaruth 15 October 2013 в 15:36
поделиться

1 ответ

Как насчет:

        const string xmlNamespace = "{http://schemas.microsoft.com/developer/msbuild/2003}";

        return  from projectPath in projectPaths
                let xml = XDocument.Load(projectPath)
                let dir = Path.GetDirectoryName(projectPath)
                from c in xml.Descendants(xmlNamespace + "Compile")
                where c.Attribute("Include").Value.EndsWith(".cs")
                select Path.Combine(dir, c.Attribute("Include").Value);
8
ответ дан 14 December 2019 в 04:51
поделиться
Другие вопросы по тегам:

Похожие вопросы: