public TOutput CompareTo <TOutput>( T oldValue, Func <TOutput> less, Func <TOutput> greater, Func <TOutput> equal = null ) { Func <TOutput> invokable = () => default; var equals = ((Equality)NewValue.CompareTo(oldValue)); if (equals == Equality.Less) { invokable = less; } else if (equals == Equality.Greater) { invokable = greater; } else { invokable = equal; } return(invokable != null ? invokable.Invoke() : default);
public void CompareTo( T oldValue, Action less, Action greater, Action equal = null ) { var equals = ((Equality)NewValue.CompareTo(oldValue)); if (equals == Equality.Less) { less?.Invoke(); } else if (equals == Equality.Greater) { greater?.Invoke(); } else { // Nothing to do equal?.Invoke(); } }