Skip to content

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.

Remove MaxMind.GeoIP2 package and enhance mapping logic (#596)

Krzysztof Pajak6bbef2150377
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 5591257ab..17b30fea3 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,7 +4,6 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" />
- <PackageVersion Include="MaxMind.GeoIP2" Version="5.2.0" />
<PackageVersion Include="ExcelMapper" Version="5.2.598" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.2" />
diff --git a/src/Business/Grand.Business.Catalog/Grand.Business.Catalog.csproj b/src/Business/Grand.Business.Catalog/Grand.Business.Catalog.csproj
index 07cf531bb..8287b3943 100644
--- a/src/Business/Grand.Business.Catalog/Grand.Business.Catalog.csproj
+++ b/src/Business/Grand.Business.Catalog/Grand.Business.Catalog.csproj
@@ -5,8 +5,5 @@
<ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
<ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
<ProjectReference Include="..\Grand.Business.Core\Grand.Business.Core.csproj" />
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="MaxMind.GeoIP2" />
- </ItemGroup>
+ </ItemGroup>
</Project>
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/Mapper/ProductProfile.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/Mapper/ProductProfile.cs
index 3d2bdc73b..d6fe0798c 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/Mapper/ProductProfile.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/Mapper/ProductProfile.cs
@@ -10,6 +10,7 @@ public class ProductProfile : Profile, IAutoMapperProfile
public ProductProfile()
{
CreateMap<ProductDto, Product>()
+ .ForMember(x => x.Id, opts => opts.Condition(src => !string.IsNullOrEmpty(src.Id)))
.ForMember(x => x.UpdatedOnUtc, opt => opt.MapFrom(o => DateTime.UtcNow))
.ForMember(x => x.ProductTypeId, opt => opt.Condition(z => z.ProductTypeId.HasValue))
.ForMember(x => x.VisibleIndividually, opt => opt.Condition(z => z.VisibleIndividually.HasValue))