public List<Deductible> GetDeductible(string enrollmentcode, short typeid) { string cacheKey = string.Concat("$Deductible_ec_type$", enrollmentcode, "_", typeid); object CachedList = m_Cache.Get(cacheKey) as List<Deductible>; List<Deductible> lstReturn = null; if (CachedList == null)//get from the service { PetfirstData pfData = new PetfirstData(); lstReturn = pfData.GetDeductible(enrollmentcode, typeid); if (lstReturn.Count > 0) { decimal defaultValue = 0; defaultValue = (from l in lstReturn where l.IsDefault select l.Amount).FirstOrDefault(); if (defaultValue != 0) { lstReturn.RemoveAll(x => x.IsDefault == false && x.Amount == defaultValue); } m_Cache.Add(cacheKey, lstReturn); } else if (!enrollmentcode.Equals(_defaultEnrollment)) { lstReturn = pfData.GetDeductible(_defaultEnrollment, typeid); if (lstReturn.Count > 0) { decimal defaultValue = 0; defaultValue = (from l in lstReturn where l.IsDefault select l.Amount).FirstOrDefault(); if (defaultValue != 0) { lstReturn.RemoveAll(x => x.IsDefault == false && x.Amount == defaultValue); } m_Cache.Add(cacheKey, lstReturn); } } } else lstReturn = (List<Deductible>)CachedList; return lstReturn; }