示例#1
0
        public IActionResult Index()
        {
            var sepet = _sepetService.GetSepetByUserId(_userManager.GetUserId(User)); // User bilgisine göre userId getirilecek.

            return(View(new SepetModel()
            {
                SepetId = sepet.Id,
                SepetItems = sepet.SepetItems.Select(i => new SepetItemModel()
                {
                    SepetItemId = i.Id,
                    ProductId = i.Product.Id,
                    Name = i.Product.Name,
                    Price = (double)i.Product.Price,   //
                    ImageUrl = i.Product.ImgUrl,
                    Quantity = i.Quantity
                }).ToList()
            }));
        }