I have a simple filter class looking like this:
public class DateFilter
{
public DateTime Value { get; set; }
public Func<FilterObject, bool> Match { get; set; }
}
Is it possible to initialize the Match function in the constructor or the object initializer using the local Value?
Example with assignment after filter creation:
var df = new DateFilter();
df.Match = (input) => df.Value > input.Date;
Is it possible to reduce the example to one statement?