using System.Collections.Generic;
private readonly static Func<string> func1 = () => "Func 1";
private readonly static Func<string> func2 = () => "Func 2";
private readonly static Func<string> func3 = () => "Func 3";
private readonly static Test test1 = new Test("1");
private readonly static Test test2 = new Test("2");
private readonly static Test test3 = new Test("3");
private readonly static Lazy<Test> lazyTest1 = new Lazy<Test>(() => {
Console.WriteLine(".Value do Test 1");
private readonly static Lazy<Test> lazyTest2 = new Lazy<Test>(() => {
Console.WriteLine(".Value do Test 2");
private readonly static Lazy<Test> lazyTest3 = new Lazy<Test>(() => {
Console.WriteLine(".Value do Test 3");
private readonly static Func<string> newFunc1 = () => lazyTest1.Value.Testing();
private readonly static Func<string> newFunc2 = () => lazyTest2.Value.Testing();
private readonly static Func<string> newFunc3 = () => lazyTest3.Value.Testing();
public static void Main()
var list = new List<Func<string>>()
var list2 = new List<Func<string>>()
var list5 = new List<Func<string>>()
foreach (var func in list.Distinct())
Console.WriteLine(func());
Console.WriteLine("---------------------");
foreach (var func in list2.Distinct())
Console.WriteLine(func());
Console.WriteLine("---------------------");
foreach (var func in list5.Distinct())
Console.WriteLine(func());
private readonly string id;
public string Testing() => $"Testing {id}!";