diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationExpressionEvaluationContextExtensions.cs b/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationExpressionEvaluationContextExtensions.cs index 9d2445a..b57990d 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationExpressionEvaluationContextExtensions.cs +++ b/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationExpressionEvaluationContextExtensions.cs @@ -61,10 +61,16 @@ public static bool ProductHasPropertyValues(this CatalogProduct product, Diction return propertyValues.Where(x => x.Key != null).All(kvp => { // return true if no specific property values were selected, treating it as all properties - if (kvp.Value.IsNullOrEmpty()) return true; - - var productProperty = product.Properties.FirstOrDefault(x => x.Name.EqualsInvariant(kvp.Key)); - if (productProperty == null) return false; + if (kvp.Value.IsNullOrEmpty()) + { + return true; + } + + var productProperty = product.Properties.FirstOrDefault(x => x.Name.EqualsIgnoreCase(kvp.Key)); + if (productProperty == null) + { + return false; + } var productPropertyValues = productProperty.Values.Where(x => x.Value != null).Select(x => x.Value.ToString()).Distinct().ToList(); return kvp.Value.Intersect(productPropertyValues, StringComparer.OrdinalIgnoreCase).Any(); diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationRuleTreePrototype.cs b/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationRuleTreePrototype.cs index 8e810b7..a8afb1c 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationRuleTreePrototype.cs +++ b/src/VirtoCommerce.DynamicAssociationsModule.Core/Models/AssociationRuleTreePrototype.cs @@ -11,23 +11,23 @@ public class AssociationRuleTreePrototype : ConditionTree public AssociationRuleTreePrototype() { var matchingRules = new BlockMatchingRules() - .WithAvailConditions( + .WithAvailableChildren( new ConditionProductCategory(), new ConditionPropertyValues() ); var resultingRules = new BlockResultingRules() - .WithAvailConditions( + .WithAvailableChildren( new ConditionProductCategory(), new ConditionPropertyValues() ); var outputTuning = new BlockOutputTuning(); - WithAvailConditions( + WithAvailableChildren( matchingRules, resultingRules, outputTuning ); - WithChildrens( + WithChildren( matchingRules, resultingRules, outputTuning diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Core/VirtoCommerce.DynamicAssociationsModule.Core.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Core/VirtoCommerce.DynamicAssociationsModule.Core.csproj index ab10e8e..efdbfea 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Core/VirtoCommerce.DynamicAssociationsModule.Core.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Core/VirtoCommerce.DynamicAssociationsModule.Core.csproj @@ -1,4 +1,4 @@ - + net8.0 true @@ -12,8 +12,8 @@ - - - + + + \ No newline at end of file diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Data.MySql/VirtoCommerce.DynamicAssociationsModule.Data.MySql.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Data.MySql/VirtoCommerce.DynamicAssociationsModule.Data.MySql.csproj index 482bf63..45434c0 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Data.MySql/VirtoCommerce.DynamicAssociationsModule.Data.MySql.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Data.MySql/VirtoCommerce.DynamicAssociationsModule.Data.MySql.csproj @@ -5,7 +5,7 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -13,7 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql.csproj index 1466a57..108d4e5 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql/VirtoCommerce.DynamicAssociationsModule.Data.PostgreSql.csproj @@ -5,7 +5,7 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -13,7 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer.csproj index f677525..1443e2c 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer/VirtoCommerce.DynamicAssociationsModule.Data.SqlServer.csproj @@ -5,7 +5,7 @@ enable - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -13,7 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Data/VirtoCommerce.DynamicAssociationsModule.Data.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Data/VirtoCommerce.DynamicAssociationsModule.Data.csproj index 8e557b1..6d0a15d 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Data/VirtoCommerce.DynamicAssociationsModule.Data.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Data/VirtoCommerce.DynamicAssociationsModule.Data.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Web/Authorization/AssociationAuthorizationHandler.cs b/src/VirtoCommerce.DynamicAssociationsModule.Web/Authorization/AssociationAuthorizationHandler.cs index 8816f16..0d07639 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Web/Authorization/AssociationAuthorizationHandler.cs +++ b/src/VirtoCommerce.DynamicAssociationsModule.Web/Authorization/AssociationAuthorizationHandler.cs @@ -100,7 +100,7 @@ protected override async Task HandleRequirementAsync(AuthorizationHandlerContext { var categories = await _categoryService.GetAsync(categoryIds, $"{CategoryResponseGroup.WithOutlines}"); - if ((catalogId == null || allowedCatalogIds.Any(x => x.EqualsInvariant(catalogId))) && categories.All(x => IsCategoryLocatedInCatalogs(x, allowedCatalogIds))) + if ((catalogId == null || allowedCatalogIds.Any(x => x.EqualsIgnoreCase(catalogId))) && categories.All(x => IsCategoryLocatedInCatalogs(x, allowedCatalogIds))) { context.Succeed(requirement); } diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Web/VirtoCommerce.DynamicAssociationsModule.Web.csproj b/src/VirtoCommerce.DynamicAssociationsModule.Web/VirtoCommerce.DynamicAssociationsModule.Web.csproj index e7b6fcf..6066958 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Web/VirtoCommerce.DynamicAssociationsModule.Web.csproj +++ b/src/VirtoCommerce.DynamicAssociationsModule.Web/VirtoCommerce.DynamicAssociationsModule.Web.csproj @@ -8,8 +8,8 @@ false - - + + diff --git a/src/VirtoCommerce.DynamicAssociationsModule.Web/module.manifest b/src/VirtoCommerce.DynamicAssociationsModule.Web/module.manifest index 5d15dc3..6c54ddd 100644 --- a/src/VirtoCommerce.DynamicAssociationsModule.Web/module.manifest +++ b/src/VirtoCommerce.DynamicAssociationsModule.Web/module.manifest @@ -4,12 +4,12 @@ 3.807.0 - 3.853.0 + 3.889.0 - - + + - + Dynamic Associations @@ -25,7 +25,7 @@ https://github.com/VirtoCommerce/vc-module-dynamic-associations false First version. - Copyright © 2011-2024 Virto Commerce. All rights reserved + Copyright © 2011-2025 Virto Commerce. All rights reserved dynamicAssociations VirtoCommerce.DynamicAssociationsModule.Web.dll VirtoCommerce.DynamicAssociationsModule.Web.Module, VirtoCommerce.DynamicAssociationsModule.Web diff --git a/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationAuthorizationHandlerTests.cs b/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationAuthorizationHandlerTests.cs index 7a0197e..a4a7d2e 100644 --- a/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationAuthorizationHandlerTests.cs +++ b/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationAuthorizationHandlerTests.cs @@ -10,9 +10,9 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using VirtoCommerce.CatalogModule.Core.Model; +using VirtoCommerce.CatalogModule.Core.Outlines; using VirtoCommerce.CatalogModule.Core.Services; using VirtoCommerce.CatalogModule.Data.Authorization; -using VirtoCommerce.CoreModule.Core.Outlines; using VirtoCommerce.DynamicAssociationsModule.Core.Model; using VirtoCommerce.DynamicAssociationsModule.Core.Model.Search; using VirtoCommerce.DynamicAssociationsModule.Web.Authorization; @@ -769,7 +769,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist } else { - var tryCreateInstance = typeof(AbstractTypeFactory<>).MakeGenericType(objectType).GetMethods().FirstOrDefault(x => x.Name.EqualsInvariant("TryCreateInstance") && x.GetParameters().Length == 0); + var tryCreateInstance = typeof(AbstractTypeFactory<>).MakeGenericType(objectType).GetMethods().FirstOrDefault(x => x.Name.EqualsIgnoreCase("TryCreateInstance") && x.GetParameters().Length == 0); result = tryCreateInstance?.Invoke(null, null); } diff --git a/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationExpressionTests.cs b/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationExpressionTests.cs index e9fa0ee..e9d7d2f 100644 --- a/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationExpressionTests.cs +++ b/tests/VirtoCommerce.DynamicAssociationsModule.Tests/AssociationExpressionTests.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using VirtoCommerce.CatalogModule.Core.Model; -using VirtoCommerce.CoreModule.Core.Outlines; +using VirtoCommerce.CatalogModule.Core.Outlines; using VirtoCommerce.DynamicAssociationsModule.Core.Model; using Xunit;