Is it possible to cache a value evaluated in a lambda expression?
问题 In the ContainsIngredients method in the following code, is it possible to cache the p.Ingredients value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purposes, but the code I'm working on references values deep inside p eg. p.InnerObject.ExpensiveMethod().Value edit: I'm using the PredicateBuilder from http://www.albahari.com/nutshell/predicatebuilder.html public class IngredientBag { private readonly Dictionary