public PetColor[] GetColorList(PetfirstCustomer mCustomer) { PetColor[] lstReturn = null; string cacheKey = "$ColorList$"; object CachedList = m_Cache.Get(cacheKey) as PetColor[]; if (CachedList == null)//get from the service { CoreServiceReference.CoreServiceClient cs = new CoreServiceClient(); CoreServiceGetColorListResponse ccResponse = cs.GetColorList(); //insert select breed on the top if (string.IsNullOrEmpty(ccResponse.Error.ErrorText))//check error { if (ccResponse.Colors !=null) { lstReturn = ccResponse.Colors; m_Cache.Add(cacheKey, lstReturn); } } else { lstReturn = null; LogException le = new LogException(); try { le.LogError(HttpContext.Current.Request.Url.AbsoluteUri, "Error during getting color list", ccResponse.Error.ErrorText, mCustomer); ///Test email server //le.SendErrorEmail(string.Concat(Request.Url.AbsoluteUri, "<br/><hr />", msg, "<hr />User Input:", le.BuildUserDataString(mCustomer))); } catch (Exception ex) { ///Test email server //lblError.Text = ex.ToString(); try { le.SendErrorEmail(string.Concat(HttpContext.Current.Request.Url.AbsoluteUri, "<br/><hr />", ex.Message, "<br />StackTrace: ", ex.StackTrace, "<br /><hr />User Input:", le.BuildUserDataString(mCustomer))); } catch { } } } } else { lstReturn = (PetColor[])CachedList; } return lstReturn; }