科技动态

Episerver Commerce 11 to 12 upgrade market breaking changes

微信扫一扫,分享到朋友圈

Episerver Commerce 11 to 12 upgrade market breaking changes

Lately, I was upgrading several projects from Episerver Commerce 11 to version 12. During the upgrade, I have noticed that there are some breaking changes regarding markets.

Episerver has made the Market
property on IOrderGroup
obsolete. If you are using it, you will see this warning message:

'IOrderGroup.Market' is obsolete: 'This property is no longer used. Use IMarketService to get the market from MarketId instead. Will remain at least until May 2019.'

At first, you are tempted to ignore it and fix later as this is just obsolete. You expect it to work as before for some time. However, this is a breaking change you will notice in runtime. The Market
property will be null.

So fix all warnings related to this property and use IMarketService
to get the market you need:

private readonly IMarketService _marketService;

public ProductController(IMarketService marketService)
{
    _marketService = marketService;
}

private void Run(ICart cart)
{
    var market = _marketService.GetMarket(cart.MarketId);
}

Episerver has documented all breaking changes here: Breaking changes in Commerce 12
.

AWS launches pay-per-session pricing for its QuickSight BI tool

上一篇

Machine Un-Learning: Why Forgetting Might Be the Key to AI

下一篇

你也可能喜欢

评论已经被关闭。

插入图片

热门栏目

Episerver Commerce 11 to 12 upgrade market breaking changes

长按储存图像,分享给朋友