Esempio n. 1
0
        public CountryDropDownViewModel GetCountries()
        {
            var listCountries = this.cache.Get(
                "Countries",
                () => this.countries
                .All()
                .Select(c => new SelectListItem
            {
                Value = c.Id.ToString(),
                Text  = c.Name
            })
                .ToList(),
                GlobalConstants.UniversalCacheTime);

            var model = new CountryDropDownViewModel
            {
                Countries = listCountries
            };

            return(model);
        }
        public CountryDropDownViewModel GetCountries()
        {
            var listCountries = this.cache.Get(
                "Countries",
                () => this.countries
                .All()
                .Select(c => new SelectListItem
                {
                    Value = c.Id.ToString(),
                    Text = c.Name
                })
                .ToList(),
                GlobalConstants.UniversalCacheTime);

            var model = new CountryDropDownViewModel
            {
                Countries = listCountries
            };

            return model;
        }