コード例 #1
0
        public async Task <IViewComponentResult> InvokeAsync(
            int id,
            string template          = "Default",
            string componentName     = "box-group-category",
            bool isShowCategoryTitle = true,
            bool isShowTitle         = true,
            bool isShowImage         = true,
            bool isShowContent       = true,
            int interval             = 5000
            )
        {
            ViewData["componentName"]       = componentName;
            ViewData["isShowCategoryTitle"] = isShowCategoryTitle;
            ViewData["categoryTitle"]       = this.repository.GetBoxCategoryTitle(id);
            ViewData["isShowTitle"]         = isShowTitle;
            ViewData["isShowImage"]         = isShowImage;
            ViewData["isShowContent"]       = isShowContent;
            ViewData["interval"]            = interval;
            var items = await repository.GetActiveBoxesOfCategory_Async(id);

            return(View(template, items));
        }