Преобразование func в предикат с использованием отражения в C #

Я в основном пытаюсь сделатьэтот, но я не знаю, какой будет T, поэтому я создаю вещи, используя деревья Отражения и Выражения.

// Input (I don't know about "Book")
Type itemType = typeof(Book);

// Actual Code
// Build up func p => p.AuthorName == "Jon Skeet"
ParameterExpression predParam = Expression.Parameter(itemType, "p");
Expression left = Expression.Field(predParam, itemType.GetField("AuthorName"));
Expression right = Expression.Constant("Jon Skeet", typeof(string));
Expression equality = Expression.Equal(left, right);
Delegate myDelegate = Expression.Lambda(equality, new ParameterExpression[] { predParam }).Compile(); // Not sure if I need this

// Build up predicate type (Predicate<Book>)
Type genericPredicateType = typeof(Predicate<>);
Type constructedPredicateType = genericPredicateType.MakeGenericType(new Type[] { itemType });

// I need an instance to use this predicate, right? (** This Fails **)
object predicateInstance = Activator.CreateInstance(constructedPredicateType, new object[] { myDelegate });

В основном у меня естьList<Book>о котором я пытаюсь подумать иInvoke егоFind метод.Find метод нуждается вPredicate<Book> вместоFunc<Book, bool>и я несколько часов бьюсь головой об этом.

Редактировать: вот первая часть трассировки ошибок:

System.MissingMethodException: Constructor on type 'System.Predicate`1[[MyProject.Book, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found.

Ответы на вопрос(2)

Ваш ответ на вопрос