コード例 #1
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var accessories = await _common_repo.Get_All_By_Type(Constant.ACCESSORIES);

            var generes = await _gr_repo.Get_ALL_ActiveAsync();

            var result = await _cat_repo.Get_All_Async();

            if (result != null)
            {
                foreach (var x in result)
                {
                    x.AccessoriesTypes = accessories;
                    string platform_ids = x.Platform_Ids;
                    if (!string.IsNullOrEmpty(platform_ids))
                    {
                        platform_ids = platform_ids.Contains(",") ? platform_ids.Trim(',') : platform_ids;
                        if (platform_ids.Length > 0)
                        {
                            x.PlatformList = await _gp_repo.Get_Supported_N_Platforms(100, platform_ids);

                            x.GenereList = generes;
                        }
                    }
                }
            }
            return(View(result));
        }
コード例 #2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var generes = await _gr_repo.Get_ALL_ActiveAsync();

            var result = await _cat_repo.Get_All_Async();

            var accessories = await _common_repo.Get_All_By_Type(Constant.ACCESSORIES);

            var featureLinks = await _fea_repo.Get_All();

            if (result != null)
            {
                foreach (var x in result)
                {
                    x.AccessoriesTypes = accessories;
                    string platform_ids = x.Platform_Ids;
                    if (!string.IsNullOrEmpty(platform_ids))
                    {
                        platform_ids = platform_ids.Contains(",") ? platform_ids.Trim(',') : platform_ids;
                        if (platform_ids.Length > 0)
                        {
                            x.GenereList   = generes;
                            x.PlatformList = await _gp_repo.Get_Supported_N_Platforms(100, platform_ids);

                            foreach (var xx in x.PlatformList)
                            {
                                xx.FeatureLinks = featureLinks.Where(o => o.Reference_Id == xx.Id && o.Reference_Name == Constant.ImageCategory.PlatformImage).ToList();
                            }
                        }
                    }
                }
            }
            return(View(result));
        }
コード例 #3
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var    list         = new List <Console_DTO>();
            string cns          = Models.Constant.ImageCategory.ConsoleImage;
            var    consoleTypes = await _common_repo.Get_All_By_Type(cns);

            foreach (var x in consoleTypes)
            {
                var console = new Console_DTO {
                    Name = x.Name, NameUrl = x.NameUrl
                };
                var prodList = await _prod_repo.GetPaginated_By_TypeId(new SearchQuery { offset = 0, rows = 12, searchTxt = cns, TypeId = x.Id });

                console.ProductList = prodList.PagedSet;
                list.Add(console);
            }
            return(View(list));
        }