public EditSettingViewModel GetOptionsForShowOnFooter() { var settings = _options.Cacheable().ToList(); var model = new EditSettingViewModel { StorName = settings.Where(a => a.Name.Equals("StoreName")).FirstOrDefault().Value, StoreKeyWords = settings.Where(a => a.Name.Equals("StoreKeyWords")).FirstOrDefault().Value, StoreDescription = settings.Where(a => a.Name.Equals("StoreDescription")).FirstOrDefault().Value, Tel1 = settings.Where(a => a.Name.Equals("Tel1")).FirstOrDefault().Value, Tel2 = settings.Where(a => a.Name.Equals("Tel2")).FirstOrDefault().Value, PhoneNumber1 = settings.Where(a => a.Name.Equals("PhoneNumber1")).FirstOrDefault().Value, PhoneNumber2 = settings.Where(a => a.Name.Equals("PhoneNumber2")).FirstOrDefault().Value, CommentModeratorStatus = Convert.ToBoolean(settings.Where(a => a.Name.Equals("CommentModeratorStatus")).FirstOrDefault().Value), Address = settings.Where(a => a.Name.Equals("Address")).FirstOrDefault().Value }; return(model); }
public IList <Product> GetAllProductsAsCacheableList() { return(_products.Cacheable().ToList()); }
public async Task <int> Count() { return(await _newses.Cacheable().CountAsync()); }