private int GetIndex(TDal item) { if (cache != null) { for (int result = 0; result < cache.Count; result++) { if (service.AreEqual(item, GetOriginal(cache[result] as TUiItem))) { return(result); } } } return(-1); }