Try our conversational search powered by Generative AI!
AI OnAI Off
EPiServer.Find.Commerce 9.5.0
EPiServer.Find.Commerce 9.5.1
Mar 23, 2016
Apr 01, 2016
Find
Closed, Fixed and tested
This code causes a StackOverflow exception when the price is edited.
protected virtual void ApplyPricingConventions( TypeConventionBuilder<IPricing> conventionBuilder) { conventionBuilder .ExcludeField(c => c.PriceReference) .ExcludeField(x => x.DefaultPrice()) .ExcludeField(x => x.Prices()); }
Steps to reproduce:
Add class like this to the project.
[ServiceConfiguration(ServiceType = typeof(CatalogContentClientConventions))] public class IndexingConfiguration : CatalogContentClientConventions { public override void ApplyConventions(IClientConventions conventions) { ApplyPricingConventions(conventions.ForInstancesOf<IPricing>()); } /// <summary> /// Prices are indexed for variations by default. The prices will be part of the variation document, /// and will contain information about the all prices for different users and groups. /// When a price event is trigged, the variation content will be reindexed. /// By removing the prices, and default price from the variation, the content will not be reindexed on price updates. /// </summary> /// <param name="conventionBuilder"></param> protected override void ApplyPricingConventions(EPiServer.Find.ClientConventions.TypeConventionBuilder<IPricing> conventionBuilder) { base.ApplyPricingConventions(conventionBuilder); conventionBuilder .ExcludeField(x => x.DefaultPrice()) .ExcludeField(x => x.Prices()); } }
Then build and try to edit a price.