New Changes waiting

This commit is contained in:
2019-11-26 20:51:54 +01:00
parent 879bd161a3
commit 1e60f78192
7 changed files with 115 additions and 3 deletions

31
Demos/DemoAction.cs Normal file
View File

@ -0,0 +1,31 @@
using System;
public class DemoAction
{
private Action justAnAction;
private Action<T> AsAction<T>()
{
var name = typeof(T).Name;
return v => Console.WriteLine(name);
}
private void ContrivedMethod()
{
var willTakeString = AsAction<string>();
willTakeString("Hello world");
// outputs: String
//type safety - squiggly
willTakeString("1");
}
Action<string> takesString; // and does stuff with it
Action<int, string> takesIntAndString; // and does stuff with it
Action<object> takesAnyObject;
Action<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int> takesMaximum;
// I've never used so many - so don't worry
}