Skip to content

Instantly share code, notes, and snippets.

@amirrajan
Last active May 4, 2020 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirrajan/b003a680029ecba5705cee6deda5991b to your computer and use it in GitHub Desktop.
Save amirrajan/b003a680029ecba5705cee6deda5991b to your computer and use it in GitHub Desktop.
Nationalize extension method.
// ToDictionary
var dictionary = new {
town0 = "Downtown",
townCommunityFarm = "Community Farm"
}.ToDictionary<string>();
// ValueOrDefault
dictonary.ValueOrDefault("someKey") ?? new SomeClass();
// Each
Range(1, 5).Each((x) =>
{
});
// Product
Range(1, 5).Product(Range(1, 5))
.Each((x, y) =>
{
});
// Fancy
Range(1, 5).Product(Range(1, 5))
.Product(Range(1, 5))
.Each((x, y, z) =>
{
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment