The API should not allow for adding duplicate assets to products

Fixed in

EPiServer.Commerce 13.29.0

Created

Sep 30, 2020

Updated

Feb 04, 2021

State

Closed, Fixed and tested


Description

See the linked support case (COM-12130), when adding multiple media item with the same key/id to the product, it cause exception (duplicate key) when saving the next time.

The reason is: 

AssetServiceDatabase.CommitAssets doesn't check duplication for the updatingRows list

We should throw an exception in this case.