public IList <ISite> GetSites() { if (RepositoryDataCache._siteDict == null) { RepositoryDataCache._siteDict = new Dictionary <int, ISite>(); siteDal.LoadSites(rd => { while (rd.Read()) { ISite site = this.CreateSite(Convert.ToInt32(rd["siteid"]), rd["name"].ToString()); //rd.CopyToEntity<ISite>(site); site.DirName = rd["dirname"].ToString(); site.Tpl = rd["tpl"].ToString(); site.State = (SiteState)int.Parse(rd["state"].ToString()); site.Location = rd["location"].ToString(); if (site.Location != null && site.Location.Trim() == "") { site.Location = null; } site.Domain = rd["domain"].ToString(); site.Address = rd["proaddress"].ToString(); site.Email = rd["proemail"].ToString(); site.Fax = rd["profax"].ToString(); site.PostCode = rd["postcode"].ToString(); site.Note = rd["note"].ToString(); site.Notice = rd["pronotice"].ToString(); site.Phone = rd["prophone"].ToString(); site.Im = rd["im"].ToString(); site.SeoTitle = rd["seotitle"].ToString(); site.SeoKeywords = rd["seokeywords"].ToString(); site.SeoDescription = rd["seodescription"].ToString(); site.Slogan = rd["proslogan"].ToString(); site.Tel = rd["protel"].ToString(); site.Language = (Languages)int.Parse(rd["language"].ToString()); RepositoryDataCache._siteDict.Add(site.Id, site); } }); } return(RepositoryDataCache._siteDict.Values.ToList()); }