public void DoSomethingWithFruit()
{
int numberOfApples = 6;
DoSomethingWithApples(numberOfApples);
}
public void MakePie(string flavour)
{
UseFlavour(flavour);
}
string pieFlavour = "Steak n Cheese";
MakePie(pieFlavour);
public void WhistleJauntyTune()
{
// let the whistling commence...
}
Action whistle = WhistleJauntyTune;
// call the action
whistle();
public void JumpAround(int numberOfTimes)
{
// jump up jump up and get down
}
Action<int> jump = JumpAround;
jump(17);
public void Something(int i, string s, double d)
{
// something something all the things...
}
var something = Something;
something(1, "1", 1.0);
public int TheAnswer()
{
return 42;
}
Func<int> answer = TheAnswer;
var a = answer();
public string DoThisThing(int number)
{
return number.ToString();
}
Func<int, string> thisThing = DoThisThing;
string s = thisThing(3); // s == "3"