public PartialViewResult GetTopicBreadcrumb(Topic topic) { var category = topic.Category; using (UnitOfWorkManager.NewUnitOfWork()) { var viewModel = new BreadcrumbViewModel { Categories = _categoryService.GetCategoryParents(category).ToList(), Topic = topic }; if (!viewModel.Categories.Any()) { viewModel.Categories.Add(topic.Category); } return PartialView("GetCategoryBreadcrumb", viewModel); } }
public PartialViewResult GetCategoryBreadcrumb(Category category) { using (UnitOfWorkManager.NewUnitOfWork()) { var viewModel = new BreadcrumbViewModel { Categories = _categoryService.GetCategoryParents(category).ToList(), Category = category }; return PartialView("GetCategoryBreadcrumb", viewModel); } }
public PartialViewResult GetCategoryBreadcrumb(Category category) { var allowedCategories = _categoryService.GetAllowedCategories(UsersRole); using (UnitOfWorkManager.NewUnitOfWork()) { var viewModel = new BreadcrumbViewModel { Categories = _categoryService.GetCategoryParents(category,allowedCategories), Category = category }; return PartialView("GetCategoryBreadcrumb", viewModel); } }