I would like to build an Expression that would equate to expected...
Expression<Func<ReferencedEntity, bool>> expected = (ReferencedEntity referencedEntity) => foreignKeys.Contains(referencedEntity.Id);
Expression<Func<ReferencedEntity, bool>> actual;
foreignKeys type is a List<object>
Here is what I have so far and I think it would use Expression.Call() method but not sure exactly how to go about it.
ParameterExpression entityParameter = Expression.Parameter(typeof(TReferencedEntity), "referencedEntity");
MemberExpression memberExpression = Expression.Property(entityParameter, "Id");
Expression convertExpression = Expression.Convert(memberExpression, typeof(object)); //This is becuase the memberExpression for Id returns a int.
//Expression containsExpression = Expression.Call(????
//actual = Expression.Lambda<Func<TReferencedEntity, bool>>(????, entityParameter);
Thanks for you help.