Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Changes with linkgenerator - replace GetUriByRouteValues to GetPathByRouteValues
supportc57626912755
diff --git a/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs b/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.csindex be54e7034..0b556b72c 100644--- a/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/Checkout/GetPaymentInfoHandler.cs@@ -1,7 +1,6 @@using Grand.Web.Features.Models.Checkout;using Grand.Web.Models.Checkout;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Routing;namespace Grand.Web.Features.Handlers.Checkout@@ -9,17 +8,15 @@ namespace Grand.Web.Features.Handlers.Checkoutpublic class GetPaymentInfoHandler : IRequestHandler<GetPaymentInfo, CheckoutPaymentInfoModel>{private readonly LinkGenerator _linkGenerator;- private readonly IHttpContextAccessor _httpContextAccessor;- public GetPaymentInfoHandler(LinkGenerator linkGenerator, IHttpContextAccessor httpContextAccessor)+ public GetPaymentInfoHandler(LinkGenerator linkGenerator){_linkGenerator = linkGenerator;- _httpContextAccessor = httpContextAccessor;}public async Task<CheckoutPaymentInfoModel> Handle(GetPaymentInfo request, CancellationToken cancellationToken){- var url = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, routeName: await request.PaymentMethod.GetControllerRouteName(), values: null);+ var url = _linkGenerator.GetPathByRouteValues(routeName: await request.PaymentMethod.GetControllerRouteName(), values: null);var model = new CheckoutPaymentInfoModel {PaymentUrl = url};diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.csindex d8e9efa26..6cc544e0c 100644--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductOverviewHandler.cs@@ -17,7 +17,6 @@ using Grand.Web.Features.Models.Products;using Grand.Web.Models.Catalog;using Grand.Web.Models.Media;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Routing;using System.Diagnostics;@@ -37,7 +36,6 @@ namespace Grand.Web.Features.Handlers.Productsprivate readonly IPictureService _pictureService;private readonly IDateTimeService _dateTimeService;private readonly IMediator _mediator;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly LinkGenerator _linkGenerator;private readonly MediaSettings _mediaSettings;private readonly CatalogSettings _catalogSettings;@@ -55,7 +53,6 @@ namespace Grand.Web.Features.Handlers.ProductsIPictureService pictureService,IDateTimeService dateTimeService,IMediator mediator,- IHttpContextAccessor httpContextAccessor,LinkGenerator linkGenerator,MediaSettings mediaSettings,CatalogSettings catalogSettings)@@ -72,7 +69,6 @@ namespace Grand.Web.Features.Handlers.Products_pictureService = pictureService;_dateTimeService = dateTimeService;_mediator = mediator;- _httpContextAccessor = httpContextAccessor;_linkGenerator = linkGenerator;_mediaSettings = mediaSettings;_catalogSettings = catalogSettings;@@ -170,8 +166,7 @@ namespace Grand.Web.Features.Handlers.ProductsShortDescription = product.GetTranslation(x => x.ShortDescription, _workContext.WorkingLanguage.Id),FullDescription = product.GetTranslation(x => x.FullDescription, _workContext.WorkingLanguage.Id),SeName = sename,- Url = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, "Product",- new { SeName = sename }),+ Url = _linkGenerator.GetPathByRouteValues("Product", new { SeName = sename }),ProductType = product.ProductTypeId,Sku = product.Sku,Gtin = product.Gtin,diff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniShoppingCartHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniShoppingCartHandler.csindex a6111f1ba..16d9dc61c 100644--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniShoppingCartHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniShoppingCartHandler.cs@@ -18,7 +18,6 @@ using Grand.Web.Features.Models.ShoppingCart;using Grand.Web.Models.Media;using Grand.Web.Models.ShoppingCart;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Routing;namespace Grand.Web.Features.Handlers.ShoppingCart@@ -37,7 +36,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartprivate readonly IPictureService _pictureService;private readonly IGroupService _groupService;private readonly IMediator _mediator;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly LinkGenerator _linkGenerator;private readonly ShoppingCartSettings _shoppingCartSettings;private readonly OrderSettings _orderSettings;@@ -57,7 +55,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartIGroupService groupService,IPictureService pictureService,IMediator mediator,- IHttpContextAccessor httpContextAccessor,LinkGenerator linkGenerator,ShoppingCartSettings shoppingCartSettings,OrderSettings orderSettings,@@ -76,7 +73,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCart_groupService = groupService;_pictureService = pictureService;_mediator = mediator;- _httpContextAccessor = httpContextAccessor;_linkGenerator = linkGenerator;_shoppingCartSettings = shoppingCartSettings;_orderSettings = orderSettings;@@ -146,8 +142,7 @@ namespace Grand.Web.Features.Handlers.ShoppingCartProductId = product.Id,ProductName = product.GetTranslation(x => x.Name, request.Language.Id),ProductSeName = sename,- ProductUrl = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, "Product",- new { SeName = sename }),+ ProductUrl = _linkGenerator.GetPathByRouteValues("Product", new { SeName = sename }),Quantity = sci.Quantity,AttributeInfo = await _productAttributeFormatter.FormatAttributes(product, sci.Attributes)};diff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniWishlistHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniWishlistHandler.csindex 14e96ce57..ee9b7e912 100644--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniWishlistHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetMiniWishlistHandler.cs@@ -13,7 +13,6 @@ using Grand.Web.Features.Models.ShoppingCart;using Grand.Web.Models.Media;using Grand.Web.Models.ShoppingCart;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Routing;namespace Grand.Web.Features.Handlers.ShoppingCart@@ -27,7 +26,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartprivate readonly IPricingService _pricingService;private readonly IPriceFormatter _priceFormatter;private readonly IPictureService _pictureService;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly LinkGenerator _linkGenerator;private readonly ShoppingCartSettings _shoppingCartSettings;private readonly MediaSettings _mediaSettings;@@ -40,7 +38,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartIPricingService priceCalculationService,IPriceFormatter priceFormatter,IPictureService pictureService,- IHttpContextAccessor httpContextAccessor,LinkGenerator linkGenerator,ShoppingCartSettings shoppingCartSettings,MediaSettings mediaSettings)@@ -52,7 +49,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCart_pricingService = priceCalculationService;_priceFormatter = priceFormatter;_pictureService = pictureService;- _httpContextAccessor = httpContextAccessor;_linkGenerator = linkGenerator;_shoppingCartSettings = shoppingCartSettings;_mediaSettings = mediaSettings;@@ -84,7 +80,7 @@ namespace Grand.Web.Features.Handlers.ShoppingCartProductId = product.Id,ProductName = product.GetTranslation(x => x.Name, request.Language.Id),ProductSeName = sename,- ProductUrl = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, "Product", new { SeName = sename }),+ ProductUrl = _linkGenerator.GetPathByRouteValues("Product", new { SeName = sename }),Quantity = sci.Quantity,AttributeInfo = await _productAttributeFormatter.FormatAttributes(product, sci.Attributes)};diff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.csindex da5edca63..58c699f90 100644--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetShoppingCartHandler.cs@@ -25,7 +25,6 @@ using Grand.Web.Features.Models.ShoppingCart;using Grand.Web.Models.Media;using Grand.Web.Models.ShoppingCart;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;using Microsoft.AspNetCore.Routing;@@ -53,7 +52,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartprivate readonly IGroupService _groupService;private readonly IMediator _mediator;private readonly IShoppingCartValidator _shoppingCartValidator;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly LinkGenerator _linkGenerator;private readonly MediaSettings _mediaSettings;private readonly OrderSettings _orderSettings;@@ -82,7 +80,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartIGroupService groupService,IMediator mediator,IShoppingCartValidator shoppingCartValidator,- IHttpContextAccessor httpContextAccessor,LinkGenerator linkGenerator,MediaSettings mediaSettings,OrderSettings orderSettings,@@ -110,7 +107,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCart_groupService = groupService;_mediator = mediator;_shoppingCartValidator = shoppingCartValidator;- _httpContextAccessor = httpContextAccessor;_linkGenerator = linkGenerator;_mediaSettings = mediaSettings;_orderSettings = orderSettings;@@ -319,7 +315,7 @@ namespace Grand.Web.Features.Handlers.ShoppingCartWarehouseId = sci.WarehouseId,ProductName = product.GetTranslation(x => x.Name, request.Language.Id),ProductSeName = sename,- ProductUrl = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, "Product", new { SeName = sename }),+ ProductUrl = _linkGenerator.GetPathByRouteValues("Product", new { SeName = sename }),Quantity = sci.Quantity,AttributeInfo = await _productAttributeFormatter.FormatAttributes(product, sci.Attributes),AllowItemEditing = _shoppingCartSettings.AllowCartItemEditing && product.VisibleIndividuallydiff --git a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.csindex 1dbf81b01..00254eadd 100644--- a/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/ShoppingCart/GetWishlistHandler.cs@@ -18,7 +18,6 @@ using Grand.Web.Features.Models.ShoppingCart;using Grand.Web.Models.Media;using Grand.Web.Models.ShoppingCart;using MediatR;-using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;using Microsoft.AspNetCore.Routing;@@ -35,7 +34,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartprivate readonly IPriceFormatter _priceFormatter;private readonly IPictureService _pictureService;private readonly IShoppingCartValidator _shoppingCartValidator;- private readonly IHttpContextAccessor _httpContextAccessor;private readonly LinkGenerator _linkGenerator;private readonly ShoppingCartSettings _shoppingCartSettings;private readonly CatalogSettings _catalogSettings;@@ -51,7 +49,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCartIPriceFormatter priceFormatter,IPictureService pictureService,IShoppingCartValidator shoppingCartValidator,- IHttpContextAccessor httpContextAccessor,LinkGenerator linkGenerator,ShoppingCartSettings shoppingCartSettings,CatalogSettings catalogSettings,@@ -66,7 +63,6 @@ namespace Grand.Web.Features.Handlers.ShoppingCart_priceFormatter = priceFormatter;_pictureService = pictureService;_shoppingCartValidator = shoppingCartValidator;- _httpContextAccessor = httpContextAccessor;_linkGenerator = linkGenerator;_shoppingCartSettings = shoppingCartSettings;_catalogSettings = catalogSettings;@@ -115,7 +111,7 @@ namespace Grand.Web.Features.Handlers.ShoppingCartProductId = product.Id,ProductName = product.GetTranslation(x => x.Name, request.Language.Id),ProductSeName = sename,- ProductUrl = _linkGenerator.GetUriByRouteValues(_httpContextAccessor.HttpContext, "Product", new { SeName = sename }),+ ProductUrl = _linkGenerator.GetPathByRouteValues("Product", new { SeName = sename }),Quantity = sci.Quantity,AttributeInfo = await _productAttributeFormatter.FormatAttributes(product, sci.Attributes),AllowItemEditing = _shoppingCartSettings.AllowCartItemEditing && product.VisibleIndividually