Beispiel #1
0
        // Bu method tüm action lardan sonra çalışır.
        public override void  OnActionExecuted(ActionExecutedContext context)
        {
            var searchProductCategoryCommand = new SearchProductCategories();
            var sonuc = SearchProductCategoriesService.HandleAsync(searchProductCategoryCommand).Result;

            ViewBag.Categories = sonuc.Value;
            base.OnActionExecuted(context);
        }
Beispiel #2
0
        // Bu method tüm action lardan sonra çalışır.
        public override void  OnActionExecuted(ActionExecutedContext context)
        {
            var searchProductCategoryCommand = new SearchProductCategories();
            var sonuc = SearchProductCategoriesService.HandleAsync(searchProductCategoryCommand).Result;

            var cart = new GetCart();

            cart.UserName = User.Identity.Name;

            var cartItems = new List <CartItem>();

            var result = getCartService.HandleAsync(cart).Result;

            ViewBag.GetCartItems = (IList <CartItem>)result.Value.CartItems ?? cartItems;
            ViewBag.CartTotal    = (decimal?)result.Value.CartTotal;

            ViewBag.Categories = sonuc.Value;

            base.OnActionExecuted(context);
        }