public ProvinceBusiness(MardisContext mardisContext, IMemoryCache memoryCache) { _provinceDao = new ProvinceDao(mardisContext); var myCache = memoryCache; if (myCache.Get(CacheName) == null) { myCache.Set(CacheName, _provinceDao.GetAll()); } }
public List <string> PopulateProvinceList(ref DropDownList dropDownList) { dropDownList.Items.Clear(); var provinceList = ProvinceDao.GetAll(); var returnList = new List <string>(); returnList.Add(""); dropDownList.Items.Add(new ListItem("")); foreach (var p in provinceList) { returnList.Add(p.Prov); dropDownList.Items.Add(new ListItem(p.Prov)); } dropDownList.SelectedIndex = 0; return(returnList); }
public List <Province> GetAll() { return(ProvinceDao.GetAll()); }