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
Further changes - move IGeoLookupService/IMeasureService to catalog project
support0bcd3ab44ba7
diff --git a/src/Business/Grand.Business.Common/Interfaces/Directory/IGeoLookupService.cs b/src/Business/Grand.Business.Catalog/Interfaces/Directory/IGeoLookupService.cssimilarity index 91%rename from src/Business/Grand.Business.Common/Interfaces/Directory/IGeoLookupService.csrename to src/Business/Grand.Business.Catalog/Interfaces/Directory/IGeoLookupService.csindex b2b90dab6..161baab03 100644--- a/src/Business/Grand.Business.Common/Interfaces/Directory/IGeoLookupService.cs+++ b/src/Business/Grand.Business.Catalog/Interfaces/Directory/IGeoLookupService.cs@@ -1,4 +1,4 @@-namespace Grand.Business.Common.Interfaces.Directory+namespace Grand.Business.Catalog.Interfaces.Directory{/// <summary>/// GEO lookup servicediff --git a/src/Business/Grand.Business.Common/Interfaces/Directory/IMeasureService.cs b/src/Business/Grand.Business.Catalog/Interfaces/Directory/IMeasureService.cssimilarity index 99%rename from src/Business/Grand.Business.Common/Interfaces/Directory/IMeasureService.csrename to src/Business/Grand.Business.Catalog/Interfaces/Directory/IMeasureService.csindex d60a3f01e..81c615757 100644--- a/src/Business/Grand.Business.Common/Interfaces/Directory/IMeasureService.cs+++ b/src/Business/Grand.Business.Catalog/Interfaces/Directory/IMeasureService.cs@@ -1,6 +1,6 @@using Grand.Domain.Directory;-namespace Grand.Business.Common.Interfaces.Directory+namespace Grand.Business.Catalog.Interfaces.Directory{/// <summary>/// Measure dimension service interfacediff --git a/src/Business/Grand.Business.Common/Services/Directory/GeoLookupService.cs b/src/Business/Grand.Business.Catalog/Services/Directory/GeoLookupService.cssimilarity index 96%rename from src/Business/Grand.Business.Common/Services/Directory/GeoLookupService.csrename to src/Business/Grand.Business.Catalog/Services/Directory/GeoLookupService.csindex b059c0487..fdec25c16 100644--- a/src/Business/Grand.Business.Common/Services/Directory/GeoLookupService.cs+++ b/src/Business/Grand.Business.Catalog/Services/Directory/GeoLookupService.cs@@ -1,14 +1,14 @@//This product contains GeoLite2 data created by MaxMind, from http://www.maxmind.com+using Grand.Business.Catalog.Interfaces.Directory;using Grand.Business.Common.Extensions;-using Grand.Business.Common.Interfaces.Directory;using Grand.Business.Common.Interfaces.Logging;using Grand.SharedKernel.Extensions;using MaxMind.GeoIP2;using MaxMind.GeoIP2.Exceptions;using MaxMind.GeoIP2.Responses;-namespace Grand.Business.Common.Services.Directory+namespace Grand.Business.Catalog.Services.Directory{/// <summary>/// GEO lookup servicediff --git a/src/Business/Grand.Business.Common/Services/Directory/MeasureService.cs b/src/Business/Grand.Business.Catalog/Services/Directory/MeasureService.cssimilarity index 99%rename from src/Business/Grand.Business.Common/Services/Directory/MeasureService.csrename to src/Business/Grand.Business.Catalog/Services/Directory/MeasureService.csindex c13348c81..7ea725a68 100644--- a/src/Business/Grand.Business.Common/Services/Directory/MeasureService.cs+++ b/src/Business/Grand.Business.Catalog/Services/Directory/MeasureService.cs@@ -1,4 +1,3 @@-using Grand.Business.Common.Interfaces.Directory;using Grand.Infrastructure.Caching;using Grand.Infrastructure.Caching.Constants;using Grand.Infrastructure.Extensions;@@ -6,8 +5,9 @@ using Grand.Domain.Data;using Grand.Domain.Directory;using Grand.SharedKernel;using MediatR;+using Grand.Business.Catalog.Interfaces.Directory;-namespace Grand.Business.Common.Services.Directory+namespace Grand.Business.Catalog.Services.Directory{/// <summary>/// Measure dimension service@@ -56,7 +56,7 @@ namespace Grand.Business.Common.Services.Directory#region Methods#region Dimensions-+/// <summary>/// Gets a measure dimension by identifier/// </summary>@@ -406,7 +406,7 @@ namespace Grand.Business.Common.Services.Directory#region MeasureUnit-+/// <summary>/// Gets a measure unit by identifier/// </summary>diff --git a/src/Business/Grand.Business.Catalog/Services/Tax/TaxService.cs b/src/Business/Grand.Business.Catalog/Services/Tax/TaxService.csindex 078bb90ec..e6b3d2b7f 100644--- a/src/Business/Grand.Business.Catalog/Services/Tax/TaxService.cs+++ b/src/Business/Grand.Business.Catalog/Services/Tax/TaxService.cs@@ -1,3 +1,4 @@+using Grand.Business.Catalog.Interfaces.Directory;using Grand.Business.Catalog.Interfaces.Tax;using Grand.Business.Catalog.Utilities;using Grand.Business.Common.Extensions;diff --git a/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs b/src/Business/Grand.Business.Catalog/Startup/StartupApplication.csindex 093119068..6d2677d1a 100644--- a/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs+++ b/src/Business/Grand.Business.Catalog/Startup/StartupApplication.cs@@ -69,6 +69,9 @@ namespace Grand.Business.Catalog.StartupserviceCollection.AddScoped<IStockQuantityService, StockQuantityService>();serviceCollection.AddScoped<IPricingService, PricingService>();serviceCollection.AddScoped<ISearchTermService, SearchTermService>();+ serviceCollection.AddScoped<IGeoLookupService, GeoLookupService>();+ serviceCollection.AddScoped<IMeasureService, MeasureService>();+}private void RegisterDiscountsService(IServiceCollection serviceCollection)diff --git a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs b/src/Business/Grand.Business.Common/Startup/StartupApplication.csindex a5d7747ff..7ed58e284 100644--- a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs+++ b/src/Business/Grand.Business.Common/Startup/StartupApplication.cs@@ -58,11 +58,10 @@ namespace Grand.Business.Common.Startupprivate void RegisterDirectoryService(IServiceCollection serviceCollection){serviceCollection.AddScoped<IDateTimeService, DateTimeService>();- serviceCollection.AddScoped<IGeoLookupService, GeoLookupService>();+serviceCollection.AddScoped<ICountryService, CountryService>();serviceCollection.AddScoped<ICurrencyService, CurrencyService>();serviceCollection.AddScoped<IExchangeRateService, ExchangeRateService>();- serviceCollection.AddScoped<IMeasureService, MeasureService>();serviceCollection.AddScoped<IGroupService, GroupService>();}private void RegisterConfigurationService(IServiceCollection serviceCollection)diff --git a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.csindex 42c3ce17d..782627989 100644--- a/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs+++ b/src/Business/Grand.Business.System/Services/ExportImport/ImportManager.cs@@ -1,6 +1,7 @@using Grand.Business.Catalog.Interfaces.Brands;using Grand.Business.Catalog.Interfaces.Categories;using Grand.Business.Catalog.Interfaces.Collections;+using Grand.Business.Catalog.Interfaces.Directory;using Grand.Business.Catalog.Interfaces.Products;using Grand.Business.Catalog.Interfaces.Tax;using Grand.Business.Checkout.Interfaces.Shipping;diff --git a/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs b/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.csindex 08e3c08bc..319a3a072 100644--- a/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs+++ b/src/Plugins/Shipping.ByWeight/Areas/Admin/Controllers/ShippingByWeightController.cs@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;using Shipping.ByWeight.Domain;using Shipping.ByWeight.Models;using Shipping.ByWeight.Services;+using Grand.Business.Catalog.Interfaces.Directory;namespace Shipping.ByWeight.Controllers{diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/MeasureServiceTests.cssimilarity index 97%rename from src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.csrename to src/Tests/Grand.Business.Catalog.Tests/Service/Directory/MeasureServiceTests.csindex b0a00aa83..1d76a7a29 100644--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs+++ b/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/MeasureServiceTests.cs@@ -1,4 +1,4 @@-using Grand.Business.Common.Services.Directory;+using Grand.Business.Catalog.Services.Directory;using Grand.Domain.Data;using Grand.Domain.Directory;using Grand.Infrastructure.Caching;@@ -7,7 +7,7 @@ using MediatR;using Microsoft.VisualStudio.TestTools.UnitTesting;using Moq;-namespace Grand.Business.Common.Tests.Services.Directory+namespace Grand.Business.Catalog.Tests.Services.Directory{[TestClass()]public class MeasureServiceTestsdiff --git a/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/SearchTermServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/SearchTermServiceTests.csindex ca8718680..e4b7049a8 100644--- a/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/SearchTermServiceTests.cs+++ b/src/Tests/Grand.Business.Catalog.Tests/Service/Directory/SearchTermServiceTests.cs@@ -1,5 +1,4 @@using Grand.Business.Catalog.Services.Directory;-using Grand.Business.Common.Services.Directory;using Grand.Domain.Common;using Grand.Domain.Data;using Grand.Infrastructure.Events;diff --git a/src/Tests/Grand.Business.Catalog.Tests/Service/Tax/TaxServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Service/Tax/TaxServiceTests.csindex 63ca13ca4..a797f4963 100644--- a/src/Tests/Grand.Business.Catalog.Tests/Service/Tax/TaxServiceTests.cs+++ b/src/Tests/Grand.Business.Catalog.Tests/Service/Tax/TaxServiceTests.cs@@ -10,6 +10,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;using Moq;using Grand.Domain.Catalog;using Grand.SharedKernel.Extensions;+using Grand.Business.Catalog.Interfaces.Directory;namespace Grand.Business.Catalog.Tests.Service.Tax{diff --git a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.csindex 6119a6eb1..87487a98b 100644--- a/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/CheckoutAttributeController.cs@@ -1,9 +1,9 @@-using Grand.Business.Checkout.Interfaces.CheckoutAttributes;+using Grand.Business.Catalog.Interfaces.Directory;+using Grand.Business.Checkout.Interfaces.CheckoutAttributes;using Grand.Business.Common.Extensions;using Grand.Business.Common.Interfaces.Directory;using Grand.Business.Common.Interfaces.Localization;using Grand.Business.Common.Interfaces.Logging;-using Grand.Business.Common.Interfaces.Stores;using Grand.Business.Common.Services.Security;using Grand.Domain.Catalog;using Grand.Domain.Directory;@@ -30,8 +30,6 @@ namespace Grand.Web.Admin.Controllersprivate readonly CurrencySettings _currencySettings;private readonly IMeasureService _measureService;private readonly MeasureSettings _measureSettings;- private readonly IStoreService _storeService;- private readonly IGroupService _groupService;private readonly ICheckoutAttributeViewModelService _checkoutAttributeViewModelService;#endregion@@ -45,8 +43,6 @@ namespace Grand.Web.Admin.ControllersCurrencySettings currencySettings,IMeasureService measureService,MeasureSettings measureSettings,- IStoreService storeService,- IGroupService groupService,ICheckoutAttributeViewModelService checkoutAttributeViewModelService){_checkoutAttributeService = checkoutAttributeService;@@ -56,8 +52,6 @@ namespace Grand.Web.Admin.Controllers_currencySettings = currencySettings;_measureService = measureService;_measureSettings = measureSettings;- _storeService = storeService;- _groupService = groupService;_checkoutAttributeViewModelService = checkoutAttributeViewModelService;}@@ -75,8 +69,7 @@ namespace Grand.Web.Admin.Controllerspublic async Task<IActionResult> List(DataSourceRequest command){var checkoutAttributes = await _checkoutAttributeViewModelService.PrepareCheckoutAttributeListModel();- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = checkoutAttributes.ToList(),Total = checkoutAttributes.Count()};@@ -170,8 +163,8 @@ namespace Grand.Web.Admin.Controllers//delete[HttpPost][PermissionAuthorizeAction(PermissionActionName.Delete)]- public async Task<IActionResult> Delete(string id,- [FromServices] IWorkContext workContext,+ public async Task<IActionResult> Delete(string id,+ [FromServices] IWorkContext workContext,[FromServices] ICustomerActivityService customerActivityService){var checkoutAttribute = await _checkoutAttributeService.GetCheckoutAttributeById(id);@@ -194,8 +187,7 @@ namespace Grand.Web.Admin.Controllerspublic async Task<IActionResult> ValueList(string checkoutAttributeId, DataSourceRequest command){var checkoutAttribute = await _checkoutAttributeViewModelService.PrepareCheckoutAttributeValuesModel(checkoutAttributeId);- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = checkoutAttribute.ToList(),Total = checkoutAttribute.Count()};diff --git a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs b/src/Web/Grand.Web.Admin/Controllers/MeasureController.csindex 696224e83..bcb2a95da 100644--- a/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/MeasureController.cs@@ -1,5 +1,4 @@using Grand.Business.Common.Interfaces.Configuration;-using Grand.Business.Common.Interfaces.Directory;using Grand.Business.Common.Interfaces.Localization;using Grand.Business.Common.Services.Security;using Grand.Web.Common.DataSource;@@ -10,6 +9,7 @@ using Grand.Infrastructure.Caching;using Grand.Web.Admin.Extensions;using Grand.Web.Admin.Models.Directory;using Microsoft.AspNetCore.Mvc;+using Grand.Business.Catalog.Interfaces.Directory;namespace Grand.Web.Admin.Controllers{@@ -62,8 +62,7 @@ namespace Grand.Web.Admin.Controllers.ToList();foreach (var wm in weightsModel)wm.IsPrimaryWeight = wm.Id == _measureSettings.BaseWeightId;- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = weightsModel,Total = weightsModel.Count};@@ -151,8 +150,7 @@ namespace Grand.Web.Admin.Controllers.ToList();foreach (var wm in dimensionsModel)wm.IsPrimaryDimension = wm.Id == _measureSettings.BaseDimensionId;- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = dimensionsModel,Total = dimensionsModel.Count};@@ -239,8 +237,7 @@ namespace Grand.Web.Admin.Controllers.Select(x => x.ToModel()).ToList();- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = unitsModel,Total = unitsModel.Count};diff --git a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.csindex c0ed064e8..90845baa4 100644--- a/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/OnlineCustomerController.cs@@ -9,6 +9,7 @@ using Grand.Web.Common.DataSource;using Grand.Web.Common.Security.Authorization;using Grand.Web.Admin.Models.Customers;using Microsoft.AspNetCore.Mvc;+using Grand.Business.Catalog.Interfaces.Directory;namespace Grand.Web.Admin.Controllers{@@ -56,8 +57,7 @@ namespace Grand.Web.Admin.Controllersvar items = new List<OnlineCustomerModel>();foreach (var x in customers){- var item = new OnlineCustomerModel()- {+ var item = new OnlineCustomerModel() {Id = x.Id,CustomerInfo = !string.IsNullOrEmpty(x.Email) ? x.Email : _translationService.GetResource("Admin.Customers.Guest"),LastIpAddress = x.LastIpAddress,@@ -70,8 +70,7 @@ namespace Grand.Web.Admin.Controllersitems.Add(item);}- var gridModel = new DataSourceResult- {+ var gridModel = new DataSourceResult {Data = items,Total = customers.TotalCount};diff --git a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs b/src/Web/Grand.Web.Admin/Controllers/SystemController.csindex f03a900c3..88ec0d3bc 100644--- a/src/Web/Grand.Web.Admin/Controllers/SystemController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/SystemController.cs@@ -1,4 +1,5 @@-using Grand.Business.Checkout.Enum;+using Grand.Business.Catalog.Interfaces.Directory;+using Grand.Business.Checkout.Enum;using Grand.Business.Checkout.Interfaces.Payments;using Grand.Business.Checkout.Interfaces.Shipping;using Grand.Business.Common.Interfaces.Directory;diff --git a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs b/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.csindex bf1057ab8..b3548163c 100644--- a/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/CheckoutAttributeViewModelService.cs@@ -15,6 +15,7 @@ using Grand.Web.Admin.Interfaces;using Grand.Web.Admin.Models.Orders;using Microsoft.AspNetCore.Mvc.Rendering;using Microsoft.AspNetCore.Http;+using Grand.Business.Catalog.Interfaces.Directory;namespace Grand.Web.Admin.Services{diff --git a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ProductViewModelService.csindex 128457a1a..5e67f36cf 100644--- a/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/ProductViewModelService.cs@@ -1,6 +1,7 @@using Grand.Business.Catalog.Extensions;using Grand.Business.Catalog.Interfaces.Categories;using Grand.Business.Catalog.Interfaces.Collections;+using Grand.Business.Catalog.Interfaces.Directory;using Grand.Business.Catalog.Interfaces.Discounts;using Grand.Business.Catalog.Interfaces.Prices;using Grand.Business.Catalog.Interfaces.Products;diff --git a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.csindex 9cdf8a247..5297d6a19 100644--- a/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs+++ b/src/Web/Grand.Web.Admin/Services/ShipmentViewModelService.cs@@ -1,4 +1,5 @@using Grand.Business.Catalog.Extensions;+using Grand.Business.Catalog.Interfaces.Directory;using Grand.Business.Catalog.Interfaces.Products;using Grand.Business.Checkout.Extensions;using Grand.Business.Checkout.Interfaces.Orders;diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetFormatBasePriceHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetFormatBasePriceHandler.csindex cdc2b5a67..685ad4914 100644--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetFormatBasePriceHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetFormatBasePriceHandler.cs@@ -1,5 +1,5 @@-using Grand.Business.Catalog.Interfaces.Prices;-using Grand.Business.Common.Interfaces.Directory;+using Grand.Business.Catalog.Interfaces.Directory;+using Grand.Business.Catalog.Interfaces.Prices;using Grand.Business.Common.Interfaces.Localization;using Grand.Web.Features.Models.Catalog;using MediatR;diff --git a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.csindex 3518f2011..1f7c907b4 100644--- a/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs+++ b/src/Web/Grand.Web/Features/Handlers/Products/GetProductDetailsPageHandler.cs@@ -34,6 +34,7 @@ using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Mvc.Rendering;using System.Globalization;using Grand.Business.Catalog.Interfaces.Brands;+using Grand.Business.Catalog.Interfaces.Directory;namespace Grand.Web.Features.Handlers.Products{