コード例 #1
0
        public static CustomResponse WithAvailableStores(this CustomResponse customResponse,
                                                         IList <int> selectedStores = null)
        {
            var availableStores = SelectListHelper.GetAvailableStores().Select(x =>
            {
                if (selectedStores?.Any(y => y.ToString() == x.Value) ?? false)
                {
                    x.Selected = true;
                }
                return(x);
            }).ToList();

            return(customResponse.With("availableStores", availableStores));
        }