public ICurrencyNotation GetClosestUnder(decimal value) { Notations = Notations.OrderBy(f => f.Value).ToList(); ICurrencyNotation NearestNotation = null; foreach (var moneyEntry in Notations) { if (moneyEntry.Value > value) { break; } if (moneyEntry.Available > 0) { NearestNotation = moneyEntry; } } return(NearestNotation); }
public void AddNotation(ICurrencyNotation notation) { Notations.Add(notation); }