Exemplo n.º 1
0
 private static bool BinaryOp(Price x, Price y, Func<decimal, decimal, bool> op)
 {
     if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) throw new ArgumentNullException();
     if (x.Unit == y.Unit) return op(x.Amount, y.Amount);
     return op(x.Amount, y.ConvertTo(x.Unit).Amount);
 }