Difficulty: Beginner
Estimated Time: 10 minutes

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Funcs are multicasts!

Test multicast funcs

Test 1

Run: scriptcs funcs.csx

using System;

public class Program
{
 public static void Main()
 {

Console.WriteLine("Test 1");

Func func = (text) => {
    Console.WriteLine(text);
    return 1;
}

Console.WriteLine("Nothing gets written before func is evaluated obviously...");

Console.WriteLine(func("Testie 1"));
Console.WriteLine();

Console.WriteLine("Test 2");

func += (text) => {
    Console.WriteLine("Haha 2!");
    return -1000;
}

Console.WriteLine(func("Testie 2"));
 }
}

App