Skip to content

Commit 6bbef21

Browse files
Remove MaxMind.GeoIP2 package and enhance mapping logic (#596)
- Removed `MaxMind.GeoIP2` package version from `Directory.Packages.props` and its reference from `Grand.Business.Catalog.csproj`. - Added new mapping conditions in `ProductProfile.cs` to improve property mapping control for `ProductDto` to `Product`.
1 parent 7ff3487 commit 6bbef21

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
</PropertyGroup>
55
<ItemGroup>
66
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" />
7-
<PackageVersion Include="MaxMind.GeoIP2" Version="5.2.0" />
87
<PackageVersion Include="ExcelMapper" Version="5.2.598" />
98
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
109
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.2" />

src/Business/Grand.Business.Catalog/Grand.Business.Catalog.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
<ProjectReference Include="..\..\Core\Grand.Infrastructure\Grand.Infrastructure.csproj" />
66
<ProjectReference Include="..\..\Core\Grand.SharedKernel\Grand.SharedKernel.csproj" />
77
<ProjectReference Include="..\Grand.Business.Core\Grand.Business.Core.csproj" />
8-
</ItemGroup>
9-
<ItemGroup>
10-
<PackageReference Include="MaxMind.GeoIP2" />
11-
</ItemGroup>
8+
</ItemGroup>
129
</Project>

src/Business/Grand.Business.Catalog/Services/ExportImport/Mapper/ProductProfile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class ProductProfile : Profile, IAutoMapperProfile
1010
public ProductProfile()
1111
{
1212
CreateMap<ProductDto, Product>()
13+
.ForMember(x => x.Id, opts => opts.Condition(src => !string.IsNullOrEmpty(src.Id)))
1314
.ForMember(x => x.UpdatedOnUtc, opt => opt.MapFrom(o => DateTime.UtcNow))
1415
.ForMember(x => x.ProductTypeId, opt => opt.Condition(z => z.ProductTypeId.HasValue))
1516
.ForMember(x => x.VisibleIndividually, opt => opt.Condition(z => z.VisibleIndividually.HasValue))

0 commit comments

Comments
 (0)