Skip to content

Instantly share code, notes, and snippets.

@takeshik
Created September 24, 2011 18:08
Show Gist options
  • Save takeshik/1239649 to your computer and use it in GitHub Desktop.
Save takeshik/1239649 to your computer and use it in GitHub Desktop.
Lazy<String> desc;
desc = new Lazy<String>(String.IsNullOrEmpty(xc.Element("desc").Value)
? ((Func<String>) (() => WebRequest.Create("http://www.takeshik.org/yacq/codes/" + id + ".desc")
.DownloadStringAsync()
.First()
))
: () => xc.Element("desc").Value
);
desc = String.IsNullOrEmpty(xc.Element("desc").Value)
? new Lazy<String>(() => WebRequest.Create("http://www.takeshik.org/yacq/codes/" + id + ".desc")
.DownloadStringAsync()
.First()
)
: new Lazy<String>(() => xc.Element("desc").Value);
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment