private XChangeRate _GetXChangeRate(CurrencyPair curPair) { if (curPair.IsIdentity) { return(new XChangeRate(1, (CurrencyPair)curPair.Clone())); } else { if (CcyList.Contains(curPair.Ccy1) && CcyList.Contains(curPair.Ccy2)) { XChangeRate xRate = FX.Where(x => x.CcyPair.IsEquivalent(curPair)).FirstOrDefault(); if (xRate == null) { return(null); } if (xRate.CcyPair.Equals(curPair)) { return(xRate); } else { return(xRate.GetInverse()); } } else { return(null); } } }