-1

I have been on that link but there are some lines I really don't understand.

1) List<()>

    private readonly List<(string MemberName, Func<T, object> Fingerprint)> _fingerprints;

2) For < Tproperty>

    public FingerprintBuilder<T> For<TProperty>(Expression<Func<T, TProperty>> memberExpression, Expression<Func<TProperty, TProperty>> fingerprint

How are they called? Can you provide some good links/explanations about them?

Nick King
  • 300
  • 2
  • 14

1 Answers1

2

When you see Func<T, TProperty> that is a delegate fingerprint, last item under <> is output, all others inputs.

So

Func<string, string, int> Fcn

Is a function that accepts 2 string parameters and returns integer value.

Lets define a function that accepts 2 strings and returns sum of their lengths

        Func<string, string, int> Fcn = (string s1, string s2) => s1.Length + s2.Length;

        var result = Fcn.Invoke("test", "test2");
        Console.WriteLine(result); // will return 9

In your case, it is just some generic types, but functionally it is the same like this example

Madushan
  • 6,977
  • 31
  • 79
Djuro
  • 384
  • 2
  • 9