I am learning Expression Trees so bear with me on this one.
The idea is to call intersect an to receive the num 3.
Guess I missing something. Can you tell me what am I doing wrong here please?
static void Main(string[] args)
{
List<int> arr1 = new List<int> { 1, 2, 3, 4, 5 };
List<int> arr2 = new List<int> { 6, 7, 8, 9, 3 };
var ex =
Expression.Lambda<Func<List<int>>>(
Expression.Call(
Expression.Constant(arr1), typeof(List<int>).GetMethod("Intersect"), Expression.Constant(arr2)));
....
Why is this throwing that value cannot be null?